summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-12 16:20:10 (GMT)
committerBrad King <brad.king@kitware.com>2020-11-12 16:26:19 (GMT)
commit98849039ccaf2db810abdeb4cf570cef68711642 (patch)
treee5ab17908f01e7edc569d464308d65ea3a2344ad /Modules/CMakeDetermineCompilerId.cmake
parentd579c4152f2ce6d4f4afda6d8b6e194893707b7e (diff)
downloadCMake-98849039ccaf2db810abdeb4cf570cef68711642.zip
CMake-98849039ccaf2db810abdeb4cf570cef68711642.tar.gz
CMake-98849039ccaf2db810abdeb4cf570cef68711642.tar.bz2
Xcode: Default to arm64 arch on Apple Silicon hosts during compiler id
In commit b6c60f14b6 (macOS: Default to arm64 architecture on Apple Silicon hosts, 2020-09-28, v3.19.0-rc1~63^2) we forgot to update the compiler id architecture selection added by commit 26673bf480 (Xcode: Explicitly specify default native architecture on macOS, 2020-07-16, v3.18.1~20^2). Issue: #21425
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 688e1d8..d907926 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -516,9 +516,16 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
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)";]])
+ if (_CMAKE_APPLE_ARCHS_DEFAULT)
+ set(id_archs "ARCHS = \"${_CMAKE_APPLE_ARCHS_DEFAULT}\";")
+ set(id_arch_active "ONLY_ACTIVE_ARCH = NO;")
+ else()
+ set(id_archs [[ARCHS = "$(NATIVE_ARCH_ACTUAL)";]])
+ set(id_arch_active "ONLY_ACTIVE_ARCH = YES;")
+ endif()
else()
set(id_archs "")
+ set(id_arch_active "ONLY_ACTIVE_ARCH = YES;")
endif()
configure_file(${CMAKE_ROOT}/Modules/CompilerId/Xcode-3.pbxproj.in
${id_dir}/CompilerId${lang}.xcodeproj/project.pbxproj @ONLY)