mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Some tests fail because Xcode runs `POST_BUILD` commands before signing the binaries they run. Tell the linker to perform ad-hoc codesign even though Xcode normally tells it not to. Other tests fail because `install_name_tool` does not revise ad-hoc signatures without the codesign `linker-signed` flag. Add that flag ourselves where needed by our tests. For now these changes help our test suite pass so we can use it to cover everything else. Both of these cases may need further investigation to update CMake to help projects in general. Issue: #21845, #21854
9 lines
356 B
CMake
9 lines
356 B
CMake
function(xcode_sign_adhoc target)
|
|
if(CMAKE_GENERATOR STREQUAL "Xcode" AND
|
|
"${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64")
|
|
# Xcode runs POST_BUILD before signing, so let the linker use ad-hoc signing.
|
|
# See CMake Issue 21845.
|
|
target_link_options(${target} PRIVATE LINKER:-adhoc_codesign)
|
|
endif()
|
|
endfunction()
|