[Lldb-commits] [lldb] r250335 - Fix codesign command with cmake.

Stephane Sezer via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 14 15:25:44 PDT 2015


Author: sas
Date: Wed Oct 14 17:25:43 2015
New Revision: 250335

URL: http://llvm.org/viewvc/llvm-project?rev=250335&view=rev
Log:
Fix codesign command with cmake.

Summary:
Looks like having a space in the Xcode path triggers this bug. We need
to use cmake -E env FOO=bar [COMMAND] to set the environment instead.

I am using cmake 3.3.1 and ninja 1.6.0 and I get this:

    [2681/2756] Linking CXX executable bin/debugserver
    FAILED: : && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++   -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -std=c++11 -fcolor-diagnostics -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-deprecated-register -Wno-vla-extension  -fno-exceptions -fno-rtti -Wno-gnu-zero-variadic-macro-arguments -Wno-zero-length-array -Wno-extended-offsetof -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names -stdlib=libc++ -Wl,-sectcreate,__TEXT,__info_plist,/Users/sas/Source/llvm/tools/lldb/tools/debugserver/source/../resources/lldb-debugserver-Info.plist tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/HasAVX.s.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFBundle.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFData.cpp.o tools/lldb/tools/de
 bugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFString.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/Genealogy.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachException.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachProcess.mm.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachTask.mm.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachThread.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachThreadList.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachVMMemory.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachVMRegion.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/mach_excServer.c.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/mach_excUser.c.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFile
 s/debugserver.dir/debugserver_vers.c.o  -o bin/debugserver  lib/liblldbDebugserverCommon.a lib/liblldbUtility.a lib/liblldbDebugserverMacOSX_I386.a lib/liblldbDebugserverMacOSX_X86_64.a -framework Cocoa -Wl,-rpath, at executable_path/../lib && cd /Users/sas/Source/llvm/build/bin && "CODESIGN_ALLOCATE=/Applications/Xcode 6.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate" codesign --force --sign lldb_codesign debugserver
    /bin/sh: CODESIGN_ALLOCATE=/Applications/Xcode 6.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: No such file or directory
    [2681/2756] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Target.cpp.o
    ninja: build stopped: subcommand failed.

Reviewers: clayborg, dawn, brucem, tfiala

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13742

Modified:
    lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt

Modified: lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt?rev=250335&r1=250334&r2=250335&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/CMakeLists.txt Wed Oct 14 17:25:43 2015
@@ -70,7 +70,7 @@ add_custom_command(TARGET debugserver
   POST_BUILD
   # --entitlements option removed, as it causes errors when debugging.
   #was: COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --entitlements ${CMAKE_CURRENT_SOURCE_DIR}/../debugserver-entitlements.plist --force --sign ${CODESIGN_IDENTITY} debugserver
-  COMMAND CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${CODESIGN_IDENTITY} debugserver
+  COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE} codesign --force --sign ${CODESIGN_IDENTITY} debugserver
   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
   )
 




More information about the lldb-commits mailing list