Commit c5e7e5df authored by Gregor Jasny's avatar Gregor Jasny

Apple: Build static library for compiler feature detection

Issue: #17870
parent e1791e84
......@@ -11,6 +11,12 @@ endif()
include(CMakeTestCompilerCommon)
# work around enforced code signing
set(__CMAKE_OLD_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
if(_CMAKE_DISABLE_CODE_SIGNING_FOR_COMPILER_ID_DETECTION)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
endif()
# Remove any cached result from an older CMake version.
# We now store this in CMakeCCompiler.cmake.
unset(CMAKE_C_COMPILER_WORKS CACHE)
......@@ -84,4 +90,6 @@ else()
endif()
endif()
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${__CMAKE_OLD_TRY_COMPILE_TARGET_TYPE})
unset(__CMAKE_OLD_TRY_COMPILE_TARGET_TYPE)
unset(__CMAKE_C_COMPILER_OUTPUT)
......@@ -11,6 +11,12 @@ endif()
include(CMakeTestCompilerCommon)
# work around enforced code signing
set(__CMAKE_OLD_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
if(_CMAKE_DISABLE_CODE_SIGNING_FOR_COMPILER_ID_DETECTION)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
endif()
# Remove any cached result from an older CMake version.
# We now store this in CMakeCXXCompiler.cmake.
unset(CMAKE_CXX_COMPILER_WORKS CACHE)
......@@ -77,4 +83,6 @@ else()
endif()
endif()
set(CMAKE_TRY_COMPILE_TARGET_TYPE ${__CMAKE_OLD_TRY_COMPILE_TARGET_TYPE})
unset(__CMAKE_OLD_TRY_COMPILE_TARGET_TYPE)
unset(__CMAKE_CXX_COMPILER_OUTPUT)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment