File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
compiler-rt/cmake/Modules Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -388,7 +388,8 @@ function(add_compiler_rt_runtime name type)
388388 set_target_properties (${libname} PROPERTIES IMPORT_PREFIX "" )
389389 set_target_properties (${libname} PROPERTIES IMPORT_SUFFIX ".lib" )
390390 endif ()
391- if (APPLE AND NOT CMAKE_LINKER MATCHES ".*lld.*" )
391+ find_program (CODESIGN codesign)
392+ if (APPLE AND NOT CMAKE_LINKER MATCHES ".*lld.*" AND CODESIGN)
392393 # Apple's linker signs the resulting dylib with an ad-hoc code signature in
393394 # most situations, except:
394395 # 1. Versions of ld64 prior to ld64-609 in Xcode 12 predate this behavior.
@@ -403,7 +404,7 @@ function(add_compiler_rt_runtime name type)
403404 # argument and looking for `invalid argument "linker-signed"` in its output.
404405 # FIXME: Remove this once all supported toolchains support `-o linker-signed`.
405406 execute_process (
406- COMMAND sh -c "codesign -f -s - -o linker-signed this-does-not-exist 2>&1 | grep -q linker-signed"
407+ COMMAND sh -c "${CODESIGN} -f -s - -o linker-signed this-does-not-exist 2>&1 | grep -q linker-signed"
407408 RESULT_VARIABLE CODESIGN_SUPPORTS_LINKER_SIGNED
408409 )
409410
@@ -414,7 +415,7 @@ function(add_compiler_rt_runtime name type)
414415
415416 add_custom_command (TARGET ${libname}
416417 POST_BUILD
417- COMMAND codesign --sign - ${EXTRA_CODESIGN_ARGUMENTS} $<TARGET_FILE:${libname} >
418+ COMMAND ${CODESIGN} --sign - ${EXTRA_CODESIGN_ARGUMENTS} $<TARGET_FILE:${libname} >
418419 WORKING_DIRECTORY ${COMPILER_RT_OUTPUT_LIBRARY_DIR}
419420 COMMAND_EXPAND_LISTS
420421 )
You can’t perform that action at this time.
0 commit comments