diff options
author | Brad King <brad.king@kitware.com> | 2022-10-03 16:40:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-10-03 16:41:59 (GMT) |
commit | 25630863eac8e015953c939ccadeab24f610e5c8 (patch) | |
tree | 090b7104b17981c15197c7197a70add352a2be50 /Tests/RunCMake/XcodeProject | |
parent | 6abd40b9798ebaffd379957dafdb790647097c64 (diff) | |
download | CMake-25630863eac8e015953c939ccadeab24f610e5c8.zip CMake-25630863eac8e015953c939ccadeab24f610e5c8.tar.gz CMake-25630863eac8e015953c939ccadeab24f610e5c8.tar.bz2 |
Tests: Add case covering XCODE_EMIT_EFFECTIVE_PLATFORM_NAME=OFF for iOS
This use case was fixed by commit a7fb4bc475 (Xcode: Set build product
locations using CONFIGURATION_BUILD_DIR, 2022-09-28). Add a test to
verify the fix.
Fixes: #23970
Diffstat (limited to 'Tests/RunCMake/XcodeProject')
-rw-r--r-- | Tests/RunCMake/XcodeProject/EffectivePlatformNameOFF.cmake | 12 | ||||
-rw-r--r-- | Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 18 |
2 files changed, 30 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/EffectivePlatformNameOFF.cmake b/Tests/RunCMake/XcodeProject/EffectivePlatformNameOFF.cmake new file mode 100644 index 0000000..4a3bf56 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/EffectivePlatformNameOFF.cmake @@ -0,0 +1,12 @@ +enable_language(CXX) + +set_property(GLOBAL PROPERTY XCODE_EMIT_EFFECTIVE_PLATFORM_NAME OFF) + +set(CMAKE_MACOSX_BUNDLE true) + +add_library(library STATIC foo.cpp) + +add_executable(main main.cpp) +target_link_libraries(main library) + +install(TARGETS library ARCHIVE DESTINATION lib) diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index d97807b..fdf4411 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -354,6 +354,7 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 6) endif() if(NOT XCODE_VERSION VERSION_LESS 5) + # XcodeMultiplatform set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeMultiplatform-build) set(RunCMake_TEST_NO_CLEAN 1) set(RunCMake_TEST_OPTIONS "${IOS_DEPLOYMENT_TARGET}") @@ -373,6 +374,23 @@ if(NOT XCODE_VERSION VERSION_LESS 5) unset(RunCMake_TEST_BINARY_DIR) unset(RunCMake_TEST_NO_CLEAN) unset(RunCMake_TEST_OPTIONS) + + # EffectivePlatformNameOFF + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/EffectivePlatformNameOFF-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS "-DCMAKE_SYSTEM_NAME=iOS" "-DCMAKE_OSX_SYSROOT=iphonesimulator") + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(EffectivePlatformNameOFF) + + run_cmake_command(EffectivePlatformNameOFF-iphonesimulator-build ${CMAKE_COMMAND} --build .) + run_cmake_command(EffectivePlatformNameOFF-iphonesimulator-install ${CMAKE_COMMAND} --build . --target install -- DESTDIR=${RunCMake_TEST_BINARY_DIR}/_install_iphonesimulator) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) + unset(RunCMake_TEST_OPTIONS) endif() if(XCODE_VERSION VERSION_GREATER_EQUAL 8) |