diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2023-08-31 07:06:53 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2023-08-31 08:13:57 (GMT) |
commit | b78a14e204fee7547f6e513a9215f6204f30c159 (patch) | |
tree | bcfec6774f5c5e6d6d1e3c20517faa5b9a521028 /Tests | |
parent | 4cd207b6f3b2b262cf4cc8eb46a2320906542d1e (diff) | |
download | CMake-b78a14e204fee7547f6e513a9215f6204f30c159.zip CMake-b78a14e204fee7547f6e513a9215f6204f30c159.tar.gz CMake-b78a14e204fee7547f6e513a9215f6204f30c159.tar.bz2 |
Xcode: reject legacy buildsystem for Xcode 14
With Xcode 14 support for the Legacy Build System has been removed
and the BuildSystemType in the WorkspaceSettings is ignored.
If CMake still generates projects targeted to the Lecacy Build
System the build preparation phase will likely fail because Xcode
for example misses any declared outputs from script invocations.
This is a hard to debug problem and CMake should reject the invalid
configuration instead.
Diffstat (limited to 'Tests')
5 files changed, 21 insertions, 3 deletions
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1-result.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1-stderr.txt new file mode 100644 index 0000000..61188b6 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1-stderr.txt @@ -0,0 +1,10 @@ +CMake Error at CMakeLists.txt:[0-9]+ \(project\): + Generator + + Xcode + + toolset specification field + + buildsystem=1 + + is not allowed with Xcode [0-9.]+\.$ diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1.cmake b/Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1.cmake new file mode 100644 index 0000000..2fc38e5 --- /dev/null +++ b/Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1.cmake @@ -0,0 +1 @@ +message(FATAL_ERROR "This should not be reached!") diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake index a742391..71cc2d4 100644 --- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake @@ -89,7 +89,11 @@ elseif("${RunCMake_GENERATOR}" STREQUAL "Xcode") set(RunCMake_GENERATOR_TOOLSET "Test Toolset") run_cmake(TestToolsetXcodeBuildSystemDefault12) set(RunCMake_GENERATOR_TOOLSET "Test Toolset,buildsystem=1") - run_cmake(TestToolsetXcodeBuildSystem1) + if(XCODE_VERSION VERSION_GREATER_EQUAL 14) + run_cmake(BadToolsetXcodeBuildSystem1) + else() + run_cmake(TestToolsetXcodeBuildSystem1) + endif() set(RunCMake_GENERATOR_TOOLSET "Test Toolset,buildsystem=12") run_cmake(TestToolsetXcodeBuildSystem12) else() diff --git a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake index b3ab624..abb357b 100644 --- a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake @@ -311,9 +311,11 @@ if (XCODE_VERSION VERSION_GREATER_EQUAL 7.3) endfunction() if(XCODE_VERSION VERSION_GREATER_EQUAL 12) - xctest_add_bundle_test(Darwin macosx "1" "$<TARGET_BUNDLE_CONTENT_DIR:TestedApp>/PlugIns") xctest_add_bundle_test(Darwin macosx "12" "$<TARGET_BUNDLE_CONTENT_DIR:TestedApp>/PlugIns") - xctest_add_bundle_test(iOS iphonesimulator "1" "$<TARGET_BUNDLE_CONTENT_DIR:TestedApp>/PlugIns") + if(XCODE_VERSION VERSION_LESS 14) + xctest_add_bundle_test(Darwin macosx "1" "$<TARGET_BUNDLE_CONTENT_DIR:TestedApp>/PlugIns") + xctest_add_bundle_test(iOS iphonesimulator "1" "$<TARGET_BUNDLE_CONTENT_DIR:TestedApp>/PlugIns") + endif() if (XCODE_VERSION VERSION_LESS 12.5) xctest_add_bundle_test(iOS iphonesimulator "12" "$<TARGET_BUNDLE_CONTENT_DIR:TestedApp>") else() |