summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-09-06 15:12:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-09-06 15:12:57 (GMT)
commitce4df15c41967df41c3061622f48a22b57674bfc (patch)
treef034084bb6c4ab9e105818be680cb391e6eb183d
parentd0cfba9d6e60ad1afe0f9b036358a09b98a5fa9d (diff)
parentb78a14e204fee7547f6e513a9215f6204f30c159 (diff)
downloadCMake-ce4df15c41967df41c3061622f48a22b57674bfc.zip
CMake-ce4df15c41967df41c3061622f48a22b57674bfc.tar.gz
CMake-ce4df15c41967df41c3061622f48a22b57674bfc.tar.bz2
Merge topic 'xcode-no-legacy-buildsystem'
b78a14e204 Xcode: reject legacy buildsystem for Xcode 14 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8762
-rw-r--r--Help/release/dev/xcode-no-legacy-buildsystem.rst8
-rw-r--r--Help/variable/CMAKE_XCODE_BUILD_SYSTEM.rst3
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx6
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1-stderr.txt10
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetXcodeBuildSystem1.cmake1
-rw-r--r--Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake6
8 files changed, 35 insertions, 6 deletions
diff --git a/Help/release/dev/xcode-no-legacy-buildsystem.rst b/Help/release/dev/xcode-no-legacy-buildsystem.rst
new file mode 100644
index 0000000..f3d1f67
--- /dev/null
+++ b/Help/release/dev/xcode-no-legacy-buildsystem.rst
@@ -0,0 +1,8 @@
+xcode-no-legacy-buildsystem
+---------------------------
+
+* The :generator:`Xcode` generator will now issue a fatal error if
+ the Legacy Build System has been selected for Xcode 14 and
+ newer. Those Xcode versions dropped support for the Legacy Build
+ System and expect the project being set-up for their current
+ Build System.
diff --git a/Help/variable/CMAKE_XCODE_BUILD_SYSTEM.rst b/Help/variable/CMAKE_XCODE_BUILD_SYSTEM.rst
index d153061..f3c213c 100644
--- a/Help/variable/CMAKE_XCODE_BUILD_SYSTEM.rst
+++ b/Help/variable/CMAKE_XCODE_BUILD_SYSTEM.rst
@@ -12,7 +12,8 @@ mature enough for use by CMake. The possible values are:
``1``
The original Xcode build system.
- This is the default when using Xcode 11.x or below.
+ This is the default when using Xcode 11.x or below and supported
+ up to Xcode 13.x.
``12``
The Xcode "new build system" introduced by Xcode 10.
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 3b9d2fd..90b8839 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -407,8 +407,10 @@ bool cmGlobalXCodeGenerator::ProcessGeneratorToolsetField(
mf->IssueMessage(MessageType::FATAL_ERROR, e);
return false;
}
- if (this->XcodeBuildSystem == BuildSystem::Twelve &&
- this->XcodeVersion < 120) {
+ if ((this->XcodeBuildSystem == BuildSystem::Twelve &&
+ this->XcodeVersion < 120) ||
+ (this->XcodeBuildSystem == BuildSystem::One &&
+ this->XcodeVersion >= 140)) {
/* clang-format off */
std::string const& e = cmStrCat(
"Generator\n"
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()