summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-24 14:18:05 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-01-24 14:18:19 (GMT)
commit3563d461dd99bd023e646ce3d45c994a83c239ca (patch)
tree72f019eeeb8f995529e3d44b7b25898f98d2b0b6
parentb17998200172405781561ac0342bbaa26796676d (diff)
parent0512428ad91600992b3c6d563ceaff3264598fd7 (diff)
downloadCMake-3563d461dd99bd023e646ce3d45c994a83c239ca.zip
CMake-3563d461dd99bd023e646ce3d45c994a83c239ca.tar.gz
CMake-3563d461dd99bd023e646ce3d45c994a83c239ca.tar.bz2
Merge topic 'cxxmodules-ninja-1.11' into release-3.25
0512428ad9 Ninja: require Ninja 1.11 for C++ module support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8099
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx20
-rw-r--r--Source/cmGlobalNinjaGenerator.h6
-rw-r--r--Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt2
-rw-r--r--Tests/RunCMake/CXXModules/RunCMakeTest.cmake2
4 files changed, 18 insertions, 12 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 077de42..980ff2f 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -738,10 +738,13 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
this->NinjaSupportsMultilineDepfile =
!cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, this->NinjaVersion,
RequiredNinjaVersionForMultilineDepfile());
- this->NinjaSupportsDyndeps =
+ this->NinjaSupportsDyndepsCxx =
!cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, this->NinjaVersion,
- RequiredNinjaVersionForDyndeps());
- if (!this->NinjaSupportsDyndeps) {
+ RequiredNinjaVersionForDyndepsCxx());
+ this->NinjaSupportsDyndepsFortran =
+ !cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, this->NinjaVersion,
+ RequiredNinjaVersionForDyndepsFortran());
+ if (!this->NinjaSupportsDyndepsFortran) {
// The ninja version number is not new enough to have upstream support.
// Our ninja branch adds ".dyndep-#" to its version number,
// where '#' is a feature-specific version number. Extract it.
@@ -752,7 +755,7 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
unsigned long dyndep = 0;
cmStrToULong(fv, &dyndep);
if (dyndep == 1) {
- this->NinjaSupportsDyndeps = true;
+ this->NinjaSupportsDyndepsFortran = true;
}
}
}
@@ -860,7 +863,7 @@ bool cmGlobalNinjaGenerator::CheckCxxModuleSupport()
"C++20 modules support via CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP "
"is experimental. It is meant only for compiler developers to try.");
}
- if (this->NinjaSupportsDyndeps) {
+ if (this->NinjaSupportsDyndepsCxx) {
return true;
}
if (diagnose) {
@@ -871,7 +874,7 @@ bool cmGlobalNinjaGenerator::CheckCxxModuleSupport()
"using Ninja version \n"
" " << this->NinjaVersion << "\n"
"due to lack of required features. "
- "Ninja " << RequiredNinjaVersionForDyndeps() << " or higher is required."
+ "Ninja " << RequiredNinjaVersionForDyndepsCxx() << " or higher is required."
;
/* clang-format on */
this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str());
@@ -882,7 +885,7 @@ bool cmGlobalNinjaGenerator::CheckCxxModuleSupport()
bool cmGlobalNinjaGenerator::CheckFortran(cmMakefile* mf) const
{
- if (this->NinjaSupportsDyndeps) {
+ if (this->NinjaSupportsDyndepsFortran) {
return true;
}
@@ -892,7 +895,8 @@ bool cmGlobalNinjaGenerator::CheckFortran(cmMakefile* mf) const
"The Ninja generator does not support Fortran using Ninja version\n"
" " << this->NinjaVersion << "\n"
"due to lack of required features. "
- "Ninja " << RequiredNinjaVersionForDyndeps() << " or higher is required."
+ "Ninja " << RequiredNinjaVersionForDyndepsFortran() <<
+ " or higher is required."
;
/* clang-format on */
mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index defa264..f89e611 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -393,7 +393,8 @@ public:
{
return "1.9";
}
- static std::string RequiredNinjaVersionForDyndeps() { return "1.10"; }
+ static std::string RequiredNinjaVersionForDyndepsCxx() { return "1.11"; }
+ static std::string RequiredNinjaVersionForDyndepsFortran() { return "1.10"; }
static std::string RequiredNinjaVersionForRestatTool() { return "1.10"; }
static std::string RequiredNinjaVersionForUnconditionalRecompactTool()
{
@@ -583,7 +584,8 @@ private:
bool NinjaSupportsImplicitOuts = false;
bool NinjaSupportsManifestRestat = false;
bool NinjaSupportsMultilineDepfile = false;
- bool NinjaSupportsDyndeps = false;
+ bool NinjaSupportsDyndepsCxx = false;
+ bool NinjaSupportsDyndepsFortran = false;
bool NinjaSupportsRestatTool = false;
bool NinjaSupportsUnconditionalRecompactTool = false;
bool NinjaSupportsMultipleOutputs = false;
diff --git a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt
index 52f781f..8ac0fc5 100644
--- a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt
+++ b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt
@@ -15,7 +15,7 @@ CMake Error:
.*
- due to lack of required features. Ninja 1.10 or higher is required.
+ due to lack of required features. Ninja 1.11 or higher is required.
|CMake Error in CMakeLists.txt:
The "nodyndep" target contains C\+\+ module sources which are not supported
diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake
index 3f17c1f..0f32ea0 100644
--- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake
@@ -38,7 +38,7 @@ endif ()
# Test behavior when the generator does not support C++20 modules.
if (NOT RunCMake_GENERATOR MATCHES "Ninja" OR
- ninja_version VERSION_LESS "1.10" OR
+ ninja_version VERSION_LESS "1.11" OR
NOT "cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
if ("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
run_cmake(NoDyndepSupport)