summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2020-07-21 11:18:50 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-07-21 11:19:02 (GMT)
commit8abeec58f339f804ad5cb4a58a75e20f0dc878a1 (patch)
tree4b67a7ecf4251b9a69b299e6ff226306d58a836b /Modules/CMakeDetermineCompilerId.cmake
parentcd580a99bdaa658487d7080279c9d394545c4f10 (diff)
parent26673bf48011a48fe0ad01e97409a32c1f50143d (diff)
downloadCMake-8abeec58f339f804ad5cb4a58a75e20f0dc878a1.zip
CMake-8abeec58f339f804ad5cb4a58a75e20f0dc878a1.tar.gz
CMake-8abeec58f339f804ad5cb4a58a75e20f0dc878a1.tar.bz2
Merge topic 'xcode-native-arch'
26673bf480 Xcode: Explicitly specify default native architecture on macOS ce624cfbd4 cmGlobalXCodeGenerator: Save CMAKE_SYSTEM_NAME in member Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5023
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index ebfd5a4..8200200 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -490,6 +490,12 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_clang_cxx_library "CLANG_CXX_LIBRARY = \"${CMAKE_MATCH_3}\";")
endif()
endif()
+ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_SYSROOT MATCHES "^$|[Mm][Aa][Cc][Oo][Ss]")
+ # When targeting macOS, use only the host architecture.
+ set(id_archs [[ARCHS = "$(NATIVE_ARCH_ACTUAL)";]])
+ else()
+ set(id_archs "")
+ endif()
configure_file(${CMAKE_ROOT}/Modules/CompilerId/Xcode-3.pbxproj.in
${id_dir}/CompilerId${lang}.xcodeproj/project.pbxproj @ONLY)
unset(_ENV_MACOSX_DEPLOYMENT_TARGET)