cxxmodules: Reference documentation in no-modules-support diagnostics

Help users avoid errors about module support when they may not need it.

While at it, polish sentence syntax in the diagnostic messages.
This commit is contained in:
Brad King
2023-10-10 09:58:32 -04:00
parent 604466b83e
commit 32438138c3
7 changed files with 45 additions and 33 deletions
+11 -9
View File
@@ -9195,8 +9195,9 @@ void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const
MessageType::FATAL_ERROR, MessageType::FATAL_ERROR,
cmStrCat( cmStrCat(
"The target named \"", this->GetName(), "The target named \"", this->GetName(),
"\" contains C++ " "\" has C++ sources that may use modules, but modules are not "
"sources that use modules which is not supported by the generator")); "supported by this generator. See the cmake-cxxmodules(7) manual "
"and the CMAKE_CXX_SCAN_FOR_MODULES variable."));
return; return;
} }
@@ -9205,8 +9206,8 @@ void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const
this->Makefile->IssueMessage( this->Makefile->IssueMessage(
MessageType::FATAL_ERROR, MessageType::FATAL_ERROR,
cmStrCat("The target named \"", this->GetName(), cmStrCat("The target named \"", this->GetName(),
"\" has C++ sources that use modules but the \"CXX\" " "\" has C++ sources that use modules, but the \"CXX\" "
"language has not been enabled")); "language has not been enabled."));
break; break;
case cmGeneratorTarget::Cxx20SupportLevel::NoCxx20: { case cmGeneratorTarget::Cxx20SupportLevel::NoCxx20: {
cmStandardLevelResolver standardResolver(this->Makefile); cmStandardLevelResolver standardResolver(this->Makefile);
@@ -9221,17 +9222,18 @@ void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const
MessageType::FATAL_ERROR, MessageType::FATAL_ERROR,
cmStrCat( cmStrCat(
"The target named \"", this->GetName(), "The target named \"", this->GetName(),
"\" has C++ sources that use modules but does not include " "\" has C++ sources that use modules, but does not include "
"\"cxx_std_20\" (or newer) among its `target_compile_features`", "\"cxx_std_20\" (or newer) among its `target_compile_features`",
effStandard)); effStandard, '.'));
} break; } break;
case cmGeneratorTarget::Cxx20SupportLevel::MissingRule: { case cmGeneratorTarget::Cxx20SupportLevel::MissingRule: {
this->Makefile->IssueMessage( this->Makefile->IssueMessage(
MessageType::FATAL_ERROR, MessageType::FATAL_ERROR,
cmStrCat("The target named \"", this->GetName(), cmStrCat("The target named \"", this->GetName(),
"\" has C++ sources that use modules but the compiler does " "\" has C++ sources that may use modules, but the compiler "
"not provide a way to discover the import graph " "does not provide a way to discover the import graph "
"dependencies")); "dependencies. See the cmake-cxxmodules(7) manual "
"and the CMAKE_CXX_SCAN_FOR_MODULES variable."));
} break; } break;
case cmGeneratorTarget::Cxx20SupportLevel::Supported: case cmGeneratorTarget::Cxx20SupportLevel::Supported:
// All is well. // All is well.
@@ -1,7 +1,10 @@
(CMake Error in CMakeLists.txt: (CMake Error in CMakeLists.txt:
The target named "cmp0155-new" has C\+\+ sources that use modules but the The target named "cmp0155-new" has C\+\+ sources that may use modules, but
compiler does not provide a way to discover the import graph dependencies the compiler does not provide a way to discover the import graph
dependencies\. See the cmake-cxxmodules\(7\) manual and the
CMAKE_CXX_SCAN_FOR_MODULES variable\.
|CMake Error in CMakeLists.txt: |CMake Error in CMakeLists.txt:
The target named "cmp0155-new" contains C\+\+ sources that use modules which The target named "cmp0155-new" has C\+\+ sources that may use modules, but
is not supported by the generator modules are not supported by this generator\. See the cmake-cxxmodules\(7\)
manual and the CMAKE_CXX_SCAN_FOR_MODULES variable\.
) )
+5 -4
View File
@@ -1,9 +1,10 @@
(CMake Error in CMakeLists.txt: (CMake Error in CMakeLists.txt:
The target named "nocxx" has C\+\+ sources that use modules but the "CXX" The target named "nocxx" has C\+\+ sources that use modules, but the "CXX"
language has not been enabled language has not been enabled\.
|CMake Error in CMakeLists.txt: |CMake Error in CMakeLists.txt:
The target named "nocxx" contains C\+\+ sources that use modules which is not The target named "nocxx" has C\+\+ sources that may use modules, but modules
supported by the generator are not supported by this generator\. See the cmake-cxxmodules\(7\) manual
and the CMAKE_CXX_SCAN_FOR_MODULES variable\.
|CMake Error in CMakeLists.txt: |CMake Error in CMakeLists.txt:
Target "nocxx" has source file Target "nocxx" has source file
+5 -4
View File
@@ -1,8 +1,9 @@
(CMake Error in CMakeLists.txt: (CMake Error in CMakeLists.txt:
The target named "nocxx20" has C\+\+ sources that use modules but does not The target named "nocxx20" has C\+\+ sources that use modules, but does not
include "cxx_std_20" \(or newer\) among its `target_compile_features`; found include "cxx_std_20" \(or newer\) among its `target_compile_features`; found
"cxx_std_17" "cxx_std_17"\.
|CMake Error in CMakeLists.txt: |CMake Error in CMakeLists.txt:
The target named "nocxx20" contains C\+\+ sources that use modules which is The target named "nocxx20" has C\+\+ sources that may use modules, but
not supported by the generator modules are not supported by this generator\. See the cmake-cxxmodules\(7\)
manual and the CMAKE_CXX_SCAN_FOR_MODULES variable\.
) )
@@ -6,6 +6,7 @@
due to lack of required features\. Ninja 1\.11 or higher is required\. due to lack of required features\. Ninja 1\.11 or higher is required\.
|CMake Error in CMakeLists.txt: |CMake Error in CMakeLists.txt:
The target named "nodyndep" contains C\+\+ sources that use modules which is The target named "nodyndep" has C\+\+ sources that may use modules, but
not supported by the generator modules are not supported by this generator\. See the cmake-cxxmodules\(7\)
manual and the CMAKE_CXX_SCAN_FOR_MODULES variable\.
) )
@@ -1,8 +1,10 @@
(CMake Error in CMakeLists.txt: (CMake Error in CMakeLists.txt:
The target named "noscanning-sf-property" has C\+\+ sources that use modules The target named "noscanning-sf-property" has C\+\+ sources that may use
but the compiler does not provide a way to discover the import graph modules, but the compiler does not provide a way to discover the import
dependencies graph dependencies\. See the cmake-cxxmodules\(7\) manual and the
CMAKE_CXX_SCAN_FOR_MODULES variable\.
|CMake Error in CMakeLists.txt: |CMake Error in CMakeLists.txt:
The target named "noscanning-sf-property" contains C\+\+ sources that use The target named "noscanning-sf-property" has C\+\+ sources that may use
modules which is not supported by the generator modules, but modules are not supported by this generator\. See the
cmake-cxxmodules\(7\) manual and the CMAKE_CXX_SCAN_FOR_MODULES variable\.
) )
@@ -1,8 +1,10 @@
(CMake Error in CMakeLists.txt: (CMake Error in CMakeLists.txt:
The target named "noscanning-target-property" has C\+\+ sources that use The target named "noscanning-target-property" has C\+\+ sources that may use
modules but the compiler does not provide a way to discover the import modules, but the compiler does not provide a way to discover the import
graph dependencies graph dependencies\. See the cmake-cxxmodules\(7\) manual and the
CMAKE_CXX_SCAN_FOR_MODULES variable\.
|CMake Error in CMakeLists.txt: |CMake Error in CMakeLists.txt:
The target named "noscanning-target-property" contains C\+\+ sources that use The target named "noscanning-target-property" has C\+\+ sources that may use
modules which is not supported by the generator modules, but modules are not supported by this generator\. See the
cmake-cxxmodules\(7\) manual and the CMAKE_CXX_SCAN_FOR_MODULES variable\.
) )