summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2017-01-15 22:23:31 (GMT)
committerBrad King <brad.king@kitware.com>2017-01-20 18:51:48 (GMT)
commit10c9c73d58b481a212d1ed87ceeb227a7654bc56 (patch)
tree10c5baf3611792fe4d3da861bca31e29b6075491 /Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
parentfe8e00f6b91d7e8614af5a5ffb2ab68775b06e1c (diff)
downloadCMake-10c9c73d58b481a212d1ed87ceeb227a7654bc56.zip
CMake-10c9c73d58b481a212d1ed87ceeb227a7654bc56.tar.gz
CMake-10c9c73d58b481a212d1ed87ceeb227a7654bc56.tar.bz2
Xcode: Control emission of EFFECTIVE_PLATFORM_NAME
When building with multiple SDKs within one project Xcode requires the usage of ${EFFECTIVE_PLATFORM_NAME} to put temporary and build outout into separate directories. For example an iOS device and simulator build use two different SDKs (iphoneos and iphonesimulator). In the past cmake tries to detect embedded toolchains that could possibly use simulators and emitted EFFECTIVE_PLATFORM_NAME (EPN) at the proper locations. In #16253 Mark noticed that if he uses macosx and iphoneos in combination the necessary EPN is not emitted. This is because CMake by default assumes macosx SDK which does not trigger EPN emission. The fist naive approach - enabling EPN unconditionally revealed that then the EPN leaks into generator expressions like $<TARGET_FILE:xxx> which might be a regression and thus is unacceptable. The next approach was to add an CMake property to enable EPN emission unconditionally. This solved the reported problem. But the EPN leakage also happened for the embedded toolchains already without anyone noticing. So the control property was turned into a tri-state one: * No definition: EPN is activated for embedded toolchains like before * ON: EPN is always emitted * OFF: EPN is never emitted That approach gives the user the chance to disable EPN for embedded toolchains and restores generator expression functionality for those. Closes: #16253
Diffstat (limited to 'Tests/RunCMake/XcodeProject/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake21
1 files changed, 21 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index 60912c2..f51a107 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -166,3 +166,24 @@ if(NOT XCODE_VERSION VERSION_LESS 6)
unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_OPTIONS)
endif()
+
+if(NOT XCODE_VERSION VERSION_LESS 5)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeMultiplatform-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(XcodeMultiplatform)
+
+ # build ios before macos
+ run_cmake_command(XcodeMultiplatform-iphonesimulator-build ${CMAKE_COMMAND} --build . -- -sdk iphonesimulator)
+ run_cmake_command(XcodeMultiplatform-iphonesimulator-install ${CMAKE_COMMAND} --build . --target install -- -sdk iphonesimulator DESTDIR=${RunCMake_TEST_BINARY_DIR}/_install_iphonesimulator)
+
+ run_cmake_command(XcodeMultiplatform-macosx-build ${CMAKE_COMMAND} --build . -- -sdk macosx)
+ run_cmake_command(XcodeMultiplatform-macosx-install ${CMAKE_COMMAND} --build . --target install -- -sdk macosx DESTDIR=${RunCMake_TEST_BINARY_DIR}/_install_macosx)
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+ unset(RunCMake_TEST_OPTIONS)
+endif()