summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/XcodeProject-Device/XcodeIOSInstallCombinedPrune.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-05-15 13:50:57 (GMT)
committerBrad King <brad.king@kitware.com>2023-05-15 14:18:54 (GMT)
commita4d114e8cdee623adb73af812968d7de67cdc639 (patch)
tree6328031449b9ea822616de87edcc4cff759c5884 /Tests/RunCMake/XcodeProject-Device/XcodeIOSInstallCombinedPrune.cmake
parentbafb6e999d41a2b613e3c92ade97025de9d2ca27 (diff)
downloadCMake-a4d114e8cdee623adb73af812968d7de67cdc639.zip
CMake-a4d114e8cdee623adb73af812968d7de67cdc639.tar.gz
CMake-a4d114e8cdee623adb73af812968d7de67cdc639.tar.bz2
Tests: Split some RunCMake.XcodeProject cases into a separate test
The `RunCMake.XcodeProject` has many cases and occasionally fails due to timeout. Move iOS and other device-specific cases to a new `RunCMake.XcodeProject-Device` test.
Diffstat (limited to 'Tests/RunCMake/XcodeProject-Device/XcodeIOSInstallCombinedPrune.cmake')
-rw-r--r--Tests/RunCMake/XcodeProject-Device/XcodeIOSInstallCombinedPrune.cmake39
1 files changed, 39 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject-Device/XcodeIOSInstallCombinedPrune.cmake b/Tests/RunCMake/XcodeProject-Device/XcodeIOSInstallCombinedPrune.cmake
new file mode 100644
index 0000000..e719428
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Device/XcodeIOSInstallCombinedPrune.cmake
@@ -0,0 +1,39 @@
+enable_language(CXX)
+
+if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10)
+endif()
+
+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_DEBUG_INFORMATION_FORMAT "dwarf")
+
+add_library(foo SHARED foo.cpp)
+install(TARGETS foo DESTINATION lib)
+
+add_library(baz SHARED foo.cpp)
+set_target_properties(
+ foo baz
+ PROPERTIES
+ XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] armv7
+ XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] armv7
+ XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] x86_64
+ XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] x86_64
+)
+
+add_library(boo SHARED foo.cpp)
+set_target_properties(
+ boo
+ PROPERTIES
+ XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] arm64
+ XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] arm64
+ XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] i386
+ XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] i386
+)
+
+add_custom_command(
+ TARGET foo
+ POST_BUILD
+ COMMAND lipo -create $<TARGET_FILE:baz> $<TARGET_FILE:boo> -output $<TARGET_FILE:foo>
+)