diff options
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 31 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 6 | ||||
-rw-r--r-- | Tests/RunCMake/CXXModules/NoCXX-stderr.txt | 12 | ||||
-rw-r--r-- | Tests/RunCMake/CXXModules/NoCXX20-stderr.txt | 14 | ||||
-rw-r--r-- | Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt | 12 | ||||
-rw-r--r-- | Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt | 8 |
9 files changed, 54 insertions, 43 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 357d0a6..43bcdd4 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -8927,25 +8927,34 @@ void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const case cmGeneratorTarget::Cxx20SupportLevel::MissingCxx: this->Makefile->IssueMessage( MessageType::FATAL_ERROR, - cmStrCat("The \"", this->GetName(), - "\" target has C++ module sources but the \"CXX\" language " - "has not been enabled")); + cmStrCat("The target named \"", this->GetName(), + "\" has C++ sources that export modules but the \"CXX\" " + "language has not been enabled")); break; case cmGeneratorTarget::Cxx20SupportLevel::MissingExperimentalFlag: this->Makefile->IssueMessage( MessageType::FATAL_ERROR, - cmStrCat("The \"", this->GetName(), - "\" target has C++ module sources but its experimental " - "support has not been requested")); + cmStrCat("The target named \"", this->GetName(), + "\" has C++ sources that export modules but its " + "experimental support has not been requested")); break; - case cmGeneratorTarget::Cxx20SupportLevel::NoCxx20: + case cmGeneratorTarget::Cxx20SupportLevel::NoCxx20: { + cmStandardLevelResolver standardResolver(this->Makefile); + auto effStandard = + standardResolver.GetEffectiveStandard(this, "CXX", config); + if (effStandard.empty()) { + effStandard = "; no C++ standard found"; + } else { + effStandard = cmStrCat("; found \"cxx_std_", effStandard, '"'); + } this->Makefile->IssueMessage( MessageType::FATAL_ERROR, cmStrCat( - "The \"", this->GetName(), - "\" target has C++ module sources but is not using at least " - "\"cxx_std_20\"")); - break; + "The target named \"", this->GetName(), + "\" has C++ sources that export modules but does not include " + "\"cxx_std_20\" (or newer) among its `target_compile_features`", + effStandard)); + } break; case cmGeneratorTarget::Cxx20SupportLevel::Supported: // All is well. break; diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index b254777..c27466a 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -438,8 +438,8 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution( if (target->HaveCxx20ModuleSources() && !this->SupportsCxxModuleDyndep()) { root->GetMakefile()->IssueMessage( MessageType::FATAL_ERROR, - cmStrCat("The \"", target->GetName(), - "\" target contains C++ module sources which are not " + cmStrCat("The target named \"", target->GetName(), + "\" contains C++ sources that export modules which is not " "supported by the generator")); } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index fd58f75..86163bf 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1374,8 +1374,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( if (gtgt->HaveCxx20ModuleSources()) { gtgt->Makefile->IssueMessage( MessageType::FATAL_ERROR, - cmStrCat("The \"", gtgt->GetName(), - "\" target contains C++ module sources which are not " + cmStrCat("The target named \"", gtgt->GetName(), + "\" contains C++ sources that export modules which is not " "supported by the generator")); } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 5f27856..b94f7e9 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -201,9 +201,9 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules() if (this->GeneratorTarget->HaveCxx20ModuleSources()) { this->Makefile->IssueMessage( MessageType::FATAL_ERROR, - cmStrCat("The \"", this->GeneratorTarget->GetName(), - "\" target contains C++ module sources which are not supported " - "by the generator")); + cmStrCat("The target named \"", this->GeneratorTarget->GetName(), + "\" contains C++ sources that export modules which is not " + "supported by the generator")); } // -- Write the custom commands for this target diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b3699ae..e2b8e6b 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -361,9 +361,9 @@ void cmVisualStudio10TargetGenerator::Generate() !this->GlobalGenerator->SupportsCxxModuleDyndep()) { this->Makefile->IssueMessage( MessageType::FATAL_ERROR, - cmStrCat("The \"", this->GeneratorTarget->GetName(), - "\" target contains C++ module sources which are not supported " - "by the generator")); + cmStrCat("The target named \"", this->GeneratorTarget->GetName(), + "\" contains C++ sources that export modules which is not " + "supported by the generator")); } this->ProjectType = computeProjectType(this->GeneratorTarget); diff --git a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt index aa7f406..102d497 100644 --- a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt @@ -6,15 +6,15 @@ Call Stack \(most recent call first\): This warning is for project developers. Use -Wno-dev to suppress it. CMake Error in CMakeLists.txt: - The "nocxx" target has C\+\+ module sources but the "CXX" language has not - been enabled + The target named "nocxx" has C\+\+ sources that export modules but the "CXX" + language has not been enabled ( CMake Error in CMakeLists.txt: -( The "nocxx" target has C\+\+ module sources but the "CXX" language has not - been enabled -| The "nocxx" target contains C\+\+ module sources which are not supported by - the generator +( The target named "nocxx" has C\+\+ sources that export modules but the "CXX" + language has not been enabled +| The target named "nocxx" contains C\+\+ sources that export modules which is + not supported by the generator ) )* CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt index 95d73b1..dd25689 100644 --- a/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt @@ -6,15 +6,17 @@ Call Stack \(most recent call first\): This warning is for project developers. Use -Wno-dev to suppress it. CMake Error in CMakeLists.txt: - The "nocxx20" target has C\+\+ module sources but is not using at least - "cxx_std_20" + The target named "nocxx20" has C\+\+ sources that export modules but does not + include "cxx_std_20" \(or newer\) among its `target_compile_features`; found + "cxx_std_17" ( CMake Error in CMakeLists.txt: -( The "nocxx20" target has C\+\+ module sources but is not using at least - "cxx_std_20" -| The "nocxx20" target contains C\+\+ module sources which are not supported by - the generator +( The target named "nocxx20" has C\+\+ sources that export modules but does not + include "cxx_std_20" \(or newer\) among its `target_compile_features`; found + "cxx_std_17" +| The target named "nocxx20" contains C\+\+ sources that export modules which + is not supported by the generator ) )* CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt index aa99af0..c2dc0b6 100644 --- a/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoCXX20ModuleFlag-stderr.txt @@ -6,15 +6,15 @@ Call Stack \(most recent call first\): This warning is for project developers. Use -Wno-dev to suppress it. CMake Error in CMakeLists.txt: - The "noexperimentalflag" target has C\+\+ module sources but its experimental - support has not been requested + The target named "noexperimentalflag" has C\+\+ sources that export modules + but its experimental support has not been requested ( CMake Error in CMakeLists.txt: -( The "noexperimentalflag" target has C\+\+ module sources but its experimental - support has not been requested -| The "noexperimentalflag" target contains C\+\+ module sources which are not - supported by the generator +( The target named "noexperimentalflag" has C\+\+ sources that export modules + but its experimental support has not been requested +| The target named "noexperimentalflag" contains C\+\+ sources that export + modules which is not supported by the generator ) )* CMake Generate step failed. Build files cannot be regenerated correctly. diff --git a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt index b63d291..c82a35a 100644 --- a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt +++ b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt @@ -13,13 +13,13 @@ This warning is for project developers. Use -Wno-dev to suppress it. 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 - by the generator + The target named "nodyndep" contains C\+\+ sources that export modules which + is not supported by the generator ( CMake Error in CMakeLists.txt: - The "nodyndep" target contains C\+\+ module sources which are not supported - by the generator + The target named "nodyndep" contains C\+\+ sources that export modules which + is not supported by the generator )*) CMake Generate step failed. Build files cannot be regenerated correctly. |