summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-07-22 14:19:56 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-07-22 14:20:21 (GMT)
commit67b84e6bc41f6d645c5a9e5e5986fc8cc0303eba (patch)
tree56683d4138dd9ef0dd8257c25d5ba5d433f13a38
parent671d8647ff77850dd6af23e12fc725074b3d0f65 (diff)
parent74beb6dba8531cc8a04e572864e88111dc46ab3d (diff)
downloadCMake-67b84e6bc41f6d645c5a9e5e5986fc8cc0303eba.zip
CMake-67b84e6bc41f6d645c5a9e5e5986fc8cc0303eba.tar.gz
CMake-67b84e6bc41f6d645c5a9e5e5986fc8cc0303eba.tar.bz2
Merge topic 'macos-check-archs'
74beb6dba8 Xcode: Restore support for CMAKE_OSX_ARCHITECTURES=$(ARCHS_STANDARD) Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Lorenz Bucher <lorenz.bucher@gmail.com> Merge-request: !9675
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake2
-rw-r--r--Tests/RunCMake/XcodeProject/ArchsStandard-stdout.txt1
-rw-r--r--Tests/RunCMake/XcodeProject/ArchsStandard.cmake4
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake2
4 files changed, 8 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 671a0b6..4a75e25 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -99,7 +99,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
# Load the resulting information strings.
if(CMAKE_${lang}_ABI_COMPILED)
message(CHECK_PASS "done")
- if(CMAKE_HOST_APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ if(CMAKE_HOST_APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES "\\$")
file(READ_MACHO "${BIN}" ARCHITECTURES archs CAPTURE_ERROR macho_error) # undocumented file() subcommand
if (NOT macho_error)
# sort and prune the list of found architectures
diff --git a/Tests/RunCMake/XcodeProject/ArchsStandard-stdout.txt b/Tests/RunCMake/XcodeProject/ArchsStandard-stdout.txt
new file mode 100644
index 0000000..460b33c
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/ArchsStandard-stdout.txt
@@ -0,0 +1 @@
+-- Detecting C compiler ABI info - done
diff --git a/Tests/RunCMake/XcodeProject/ArchsStandard.cmake b/Tests/RunCMake/XcodeProject/ArchsStandard.cmake
new file mode 100644
index 0000000..56d9e64
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/ArchsStandard.cmake
@@ -0,0 +1,4 @@
+if(NOT CMAKE_OSX_ARCHITECTURES STREQUAL "$(ARCHS_STANDARD)")
+ message(FATAL_ERROR "CMAKE_OSX_ARCHITECTURES is not $(ARCHS_STANDARD)")
+endif()
+enable_language(C)
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index c124950..5e22666 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -9,6 +9,8 @@ function(RunClean)
endfunction()
RunClean()
+run_cmake_with_options(ArchsStandard "-DCMAKE_OSX_ARCHITECTURES=$(ARCHS_STANDARD)")
+
run_cmake(ExplicitCMakeLists)
run_cmake(ImplicitCMakeLists)
run_cmake(InterfaceLibSources)