summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2023-06-22 09:57:36 (GMT)
committerGregor Jasny <gjasny@googlemail.com>2023-07-11 18:20:25 (GMT)
commit25977e177be14189796630fac9f1d6ecdccc56bd (patch)
treea69034a0899419229e2850925ef65174af7af9d2 /Tests
parent7ad290bf9c3f0d262cc2ef6ee141de88605e7af9 (diff)
downloadCMake-25977e177be14189796630fac9f1d6ecdccc56bd.zip
CMake-25977e177be14189796630fac9f1d6ecdccc56bd.tar.gz
CMake-25977e177be14189796630fac9f1d6ecdccc56bd.tar.bz2
apple: add preliminary visionOS support
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c4
-rw-r--r--Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake6
-rw-r--r--Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake23
-rw-r--r--Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake2
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake2
5 files changed, 35 insertions, 2 deletions
diff --git a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c
index 5e0f40f..c00fce7 100644
--- a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c
+++ b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c
@@ -5,6 +5,10 @@
# if __MAC_OS_X_VERSION_MIN_REQUIRED != __MAC_10_11
# error macOS deployment version mismatch
# endif
+#elif TARGET_OS_XR
+# if __XR_OS_VERSION_MIN_REQUIRED != __XROS_1_0
+# error visionOS deployment version mismatch
+# endif
#elif TARGET_OS_IOS
# if __IPHONE_OS_VERSION_MIN_REQUIRED != __IPHONE_9_1
# error iOS deployment version mismatch
diff --git a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake
index 234ceef..80e3877 100644
--- a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake
+++ b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.cmake
@@ -7,6 +7,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "visionOS")
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "1.0")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
+ set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
elseif(CMAKE_SYSTEM_NAME STREQUAL "watchOS")
set(CMAKE_OSX_DEPLOYMENT_TARGET "2.0")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
diff --git a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake
index e2ed045..b3ab624 100644
--- a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake
@@ -93,6 +93,25 @@ if(NOT XCODE_VERSION VERSION_LESS 7.1)
unset(RunCMake_TEST_OPTIONS)
endif()
+if(NOT XCODE_VERSION VERSION_LESS 15)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesVisionOS-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_SYSTEM_NAME=visionOS"
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(XcodeBundles)
+ run_cmake_command(XcodeBundles-build-visionOS ${CMAKE_COMMAND} --build .)
+ run_cmake_command(XcodeBundles-install-visionOS ${CMAKE_COMMAND} --build . --target install)
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+ unset(RunCMake_TEST_OPTIONS)
+endif()
+
if(NOT XCODE_VERSION VERSION_LESS 7)
set(RunCMake_TEST_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/osx.cmake")
run_cmake(XcodeTbdStub)
@@ -242,6 +261,10 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 8)
deployment_target_test(tvOS appletvsimulator)
deployment_target_test(watchOS watchos)
deployment_target_test(watchOS watchsimulator)
+ if(XCODE_VERSION VERSION_GREATER_EQUAL 15)
+ deployment_target_test(visionOS xros)
+ deployment_target_test(visionOS xrsimulator)
+ endif()
endif()
if(XCODE_VERSION VERSION_GREATER_EQUAL 8)
diff --git a/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake b/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake
index a9fafd2..376a7fc 100644
--- a/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake
+++ b/Tests/RunCMake/XcodeProject-Device/XcodeBundles.cmake
@@ -9,7 +9,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
endif()
-if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS")
+if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake
index 9b6581c..8e4745a 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake
@@ -126,7 +126,7 @@ if ((CMAKE_SYSTEM_NAME STREQUAL "Windows" AND
((DEFINED MSVC_VERSION AND MSVC_VERSION GREATER "1900") OR (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang" AND NOT CMAKE_C_SIMULATE_ID STREQUAL "MSVC")))
OR (CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND
(NOT CMAKE_C_COMPILER_ID STREQUAL "SunPro" OR CMAKE_C_COMPILER_VERSION GREATER "5.9"))
- OR CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|watchOS|Linux|BSD|MSYS|CYGWIN")
+ OR CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|visionOS|watchOS|Linux|BSD|MSYS|CYGWIN")
run_cmake(feature-WHOLE_ARCHIVE)
run_cmake_target(feature-WHOLE_ARCHIVE link-exe main)
endif()