summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-03-18 16:51:00 (GMT)
committerBrad King <brad.king@kitware.com>2024-03-19 13:52:32 (GMT)
commit2149dbd379896fd1c80700fefecc2b812a267b41 (patch)
tree778a1424cd4cb100aeb6b255601b765b9c21a9d4
parentbe642f6ed52e3633e6a173a2d39043a5f10c91eb (diff)
downloadCMake-2149dbd379896fd1c80700fefecc2b812a267b41.zip
CMake-2149dbd379896fd1c80700fefecc2b812a267b41.tar.gz
CMake-2149dbd379896fd1c80700fefecc2b812a267b41.tar.bz2
generate_apple_architecture_selection_file: Document $(ARCHS_STANDARD) support
Also add a test case. Fixes: #25780
-rw-r--r--Modules/CMakePackageConfigHelpers.cmake4
-rw-r--r--Tests/RunCMake/CMakePackage/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode.cmake1
5 files changed, 10 insertions, 1 deletions
diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index 59d604a..0c04608 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -304,6 +304,10 @@ Generating an Apple Platform Selection File
``UNIVERSAL_ARCHITECTURES <arch>...``
Architectures provided by the ``UNIVERSAL_INCLUDE_FILE``.
+ The list may include ``$(ARCHS_STANDARD)`` to support consumption using
+ the :generator:`Xcode` generator, but the architectures should always
+ be listed individually too.
+
``UNIVERSAL_INCLUDE_FILE <file>``
A file to load when :variable:`CMAKE_OSX_ARCHITECTURES` contains
a (non-strict) subset of the ``UNIVERSAL_ARCHITECTURES`` and
diff --git a/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake b/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake
index 7d9d42a..ccf0a86 100644
--- a/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake
@@ -102,6 +102,9 @@ if(APPLE AND CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
endif()
apple_import(watchos watchOS "${watch_archs}" watchos)
apple_import(ios-simulator iOS "${macos_archs}" iphonesimulator)
+ if(RunCMake_GENERATOR STREQUAL "Xcode")
+ apple_import(ios-simulator-xcode iOS "$(ARCHS_STANDARD)" iphonesimulator)
+ endif()
if(select_archs)
foreach(arch IN LISTS macos_archs)
apple_import(ios-simulator-${arch} iOS "${arch}" iphonesimulator)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake
index ab66407..c935c3a 100644
--- a/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake
+++ b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake
@@ -9,7 +9,7 @@ if(IOS_SIMULATOR_SELECT_ARCHS)
INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
SINGLE_ARCHITECTURES ${IOS_SIMULATOR_SELECT_ARCHS}
SINGLE_ARCHITECTURE_INCLUDE_FILES ${IOS_SIMULATOR_SELECT_FILES}
- UNIVERSAL_ARCHITECTURES ${IOS_SIMULATOR_SELECT_ARCHS}
+ UNIVERSAL_ARCHITECTURES ${IOS_SIMULATOR_SELECT_ARCHS} $(ARCHS_STANDARD)
UNIVERSAL_INCLUDE_FILE "lib/ios-simulator/cmake/mylib/mylib-targets.cmake"
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mylib-select-arch-install.cmake DESTINATION lib/ios-simulator/cmake/mylib RENAME mylib-select-arch.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode-stdout.txt
new file mode 100644
index 0000000..4ca925d
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/ios-simulator/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode.cmake b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode.cmake
new file mode 100644
index 0000000..90624a0
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-xcode.cmake
@@ -0,0 +1 @@
+include(apple-import-ios-simulator.cmake)