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:20 (GMT)
commit07206384ecad077288acf25b1eb2ea08a29884e9 (patch)
tree01be3c2a4f2a76ae8d846fc2106feb22420ef715
parentec381070fa2f2ce34296a7593510585ae19fde91 (diff)
parent8d4e510a44cd7bdb7598464008a9e72609b461cd (diff)
downloadCMake-07206384ecad077288acf25b1eb2ea08a29884e9.zip
CMake-07206384ecad077288acf25b1eb2ea08a29884e9.tar.gz
CMake-07206384ecad077288acf25b1eb2ea08a29884e9.tar.bz2
Merge topic 'cxxmodules-ninja-1.11'
8d4e510a44 Merge branch 'backport-cxxmodules-ninja-1.11' into cxxmodules-ninja-1.11 7abddcab08 Ninja: require Ninja 1.11 for C++ module support 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.cxx21
-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, 19 insertions, 12 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index a1eadb9..b80a06e 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -742,10 +742,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.
@@ -756,7 +759,7 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
unsigned long dyndep = 0;
cmStrToULong(fv, &dyndep);
if (dyndep == 1) {
- this->NinjaSupportsDyndeps = true;
+ this->NinjaSupportsDyndepsFortran = true;
}
}
}
@@ -856,7 +859,7 @@ bool cmGlobalNinjaGenerator::CheckLanguages(
bool cmGlobalNinjaGenerator::CheckCxxModuleSupport()
{
this->CxxModuleSupportCheck();
- if (this->NinjaSupportsDyndeps) {
+ if (this->NinjaSupportsDyndepsCxx) {
return true;
}
bool const diagnose = !this->DiagnosedCxxModuleNinjaSupport &&
@@ -869,7 +872,8 @@ 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());
@@ -880,7 +884,7 @@ bool cmGlobalNinjaGenerator::CheckCxxModuleSupport()
bool cmGlobalNinjaGenerator::CheckFortran(cmMakefile* mf) const
{
- if (this->NinjaSupportsDyndeps) {
+ if (this->NinjaSupportsDyndepsFortran) {
return true;
}
@@ -890,7 +894,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 2b6d1cd..1436c83 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -389,7 +389,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()
{
@@ -578,7 +579,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 2bee19f..a0b2572 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 01d59f8..78afd5e 100644
--- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake
@@ -38,7 +38,7 @@ endif ()
set(generator_supports_cxx_modules 0)
if (RunCMake_GENERATOR MATCHES "Ninja" AND
- ninja_version VERSION_GREATER_EQUAL "1.10" AND
+ ninja_version VERSION_GREATER_EQUAL "1.11" AND
"cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(generator_supports_cxx_modules 1)
endif ()