summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-09-22 18:35:55 (GMT)
committerBrad King <brad.king@kitware.com>2023-09-26 14:04:07 (GMT)
commitf9f5751d1875bc9d2fac754af04dae9437ac07b1 (patch)
treefdee3e95d03d26c4c1a8feb6cc2e1ba9237b175c
parente0765c2c4620ccd4b86dfd05ba051ca577ab88c3 (diff)
downloadCMake-f9f5751d1875bc9d2fac754af04dae9437ac07b1.zip
CMake-f9f5751d1875bc9d2fac754af04dae9437ac07b1.tar.gz
CMake-f9f5751d1875bc9d2fac754af04dae9437ac07b1.tar.bz2
Tests: Clarify RunCMake.XcFramework conditions testing Xcode version
In commit 7050ac56a1 (macOS: Add support for linking against .xcframework folders, 2023-05-17) used conditions based on the AppleClang compiler version, but we actually want to check the Xcode version.
-rw-r--r--Tests/RunCMake/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/XcFramework/RunCMakeTest.cmake14
2 files changed, 8 insertions, 8 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 14b94c7..4387c5b 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -722,7 +722,7 @@ if((CMAKE_C_COMPILER_ID STREQUAL "AppleClang"
set(CMake_TEST_XcFramework ON)
endif()
if(CMake_TEST_XcFramework AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 11.0)
- set(XcFramework_ARGS -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION})
+ set(XcFramework_ARGS -DCMake_TEST_XCODE_VERSION=${CMake_TEST_XCODE_VERSION})
add_RunCMake_test(XcFramework)
# This test can take a very long time due to lots of combinations.
diff --git a/Tests/RunCMake/XcFramework/RunCMakeTest.cmake b/Tests/RunCMake/XcFramework/RunCMakeTest.cmake
index 22c28b4..d0faaae 100644
--- a/Tests/RunCMake/XcFramework/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcFramework/RunCMakeTest.cmake
@@ -14,13 +14,13 @@ function(create_libraries type)
create_library(${type} ios iOS "arm64" iphoneos)
create_library(${type} tvos tvOS "arm64" appletvos)
create_library(${type} watchos watchOS "armv7k\\\\;arm64_32" watchos)
- if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
+ if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15)
create_library(${type} visionos visionOS "arm64" xros)
endif()
create_library(${type} ios-simulator iOS "${macos_archs_2}" iphonesimulator)
create_library(${type} tvos-simulator tvOS "${macos_archs_2}" appletvsimulator)
create_library(${type} watchos-simulator watchOS "${watch_sim_archs_2}" watchsimulator)
- if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
+ if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15)
create_library(${type} visionos-simulator visionOS "${macos_archs_2}" xrsimulator)
endif()
endfunction()
@@ -51,22 +51,22 @@ function(create_executables name type)
create_executable(${name}-ios ${type} iOS "arm64" iphoneos)
create_executable(${name}-tvos ${type} tvOS "arm64" appletvos)
create_executable(${name}-watchos ${type} watchOS "armv7k\\\\;arm64_32" watchos)
- if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
+ if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15)
create_executable(${name}-visionos ${type} visionOS "arm64" xros)
endif()
create_executable(${name}-ios-simulator ${type} iOS "${macos_archs_2}" iphonesimulator)
create_executable(${name}-tvos-simulator ${type} tvOS "${macos_archs_2}" appletvsimulator)
create_executable(${name}-watchos-simulator ${type} watchOS "${watch_sim_archs_2}" watchsimulator)
- if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
+ if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15)
create_executable(${name}-visionos-simulator ${type} visionOS "${macos_archs_2}" xrsimulator)
endif()
endfunction()
set(xcframework_platforms macos ios tvos watchos ios-simulator tvos-simulator watchos-simulator)
-if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
+if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15)
list(APPEND xcframework_platforms visionos visionos-simulator)
endif()
-if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
+if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 12)
set(macos_archs_1 "x86_64\\;arm64")
set(macos_archs_2 "x86_64\\\\;arm64")
set(watch_sim_archs_2 "x86_64")
@@ -87,7 +87,7 @@ run_cmake_with_options(create-executable-incomplete -DCMAKE_SYSTEM_NAME=Darwin "
create_executables(target-library library)
create_executables(target-framework framework)
run_cmake_with_options(create-executable-target-incomplete -DCMAKE_SYSTEM_NAME=Darwin "-DCMAKE_OSX_ARCHITECTURES=${macos_archs_1}" -DMYLIB_LIBRARY=${RunCMake_BINARY_DIR}/create-xcframework-incomplete-build/mylib.xcframework)
-if(RunCMake_GENERATOR STREQUAL "Xcode" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
+if(RunCMake_GENERATOR STREQUAL "Xcode" AND CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 12)
create_executables(library-link-phase library)
create_executables(framework-link-phase framework)
run_cmake_with_options(create-executable-incomplete-link-phase -DCMAKE_SYSTEM_NAME=Darwin "-DCMAKE_OSX_ARCHITECTURES=${macos_archs_1}" -DMYLIB_LIBRARY=${RunCMake_BINARY_DIR}/create-xcframework-incomplete-build/mylib.xcframework)