summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-10-11 14:29:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-10-11 14:29:58 (GMT)
commit8783a3ec78d08c1726e9c609ccfea89491410575 (patch)
tree8c7d000643132e674b932fd63c6175cafd0255ab
parent9872909f995ae5565ec3578893338b481359bb1d (diff)
parent32438138c331bc0bc24b47c9ac0cc93c8298c8d5 (diff)
downloadCMake-8783a3ec78d08c1726e9c609ccfea89491410575.zip
CMake-8783a3ec78d08c1726e9c609ccfea89491410575.tar.gz
CMake-8783a3ec78d08c1726e9c609ccfea89491410575.tar.bz2
Merge topic 'cxxmodules-diagnostics' into release-3.28
32438138c3 cxxmodules: Reference documentation in no-modules-support diagnostics 604466b83e Tests: Enforce RunCMake.CXXModules no-modules-support diagnostics strictly Acked-by: Kitware Robot <kwrobot@kitware.com> Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !8866
-rw-r--r--Source/cmGeneratorTarget.cxx20
-rw-r--r--Tests/RunCMake/CXXModules/CMP0155-NEW-stderr.txt14
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX-stderr.txt18
-rw-r--r--Tests/RunCMake/CXXModules/NoCXX20-stderr.txt12
-rw-r--r--Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt22
-rw-r--r--Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-stderr.txt15
-rw-r--r--Tests/RunCMake/CXXModules/NoScanningTargetProperty-stderr.txt15
7 files changed, 59 insertions, 57 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 01af14f..2ea18bd 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -9195,8 +9195,9 @@ void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const
MessageType::FATAL_ERROR,
cmStrCat(
"The target named \"", this->GetName(),
- "\" contains C++ "
- "sources that use modules which is not supported by the generator"));
+ "\" has C++ sources that may use modules, but modules are not "
+ "supported by this generator. See the cmake-cxxmodules(7) manual "
+ "and the CMAKE_CXX_SCAN_FOR_MODULES variable."));
return;
}
@@ -9205,8 +9206,8 @@ void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const
this->Makefile->IssueMessage(
MessageType::FATAL_ERROR,
cmStrCat("The target named \"", this->GetName(),
- "\" has C++ sources that use modules but the \"CXX\" "
- "language has not been enabled"));
+ "\" has C++ sources that use modules, but the \"CXX\" "
+ "language has not been enabled."));
break;
case cmGeneratorTarget::Cxx20SupportLevel::NoCxx20: {
cmStandardLevelResolver standardResolver(this->Makefile);
@@ -9221,17 +9222,18 @@ void cmGeneratorTarget::CheckCxxModuleStatus(std::string const& config) const
MessageType::FATAL_ERROR,
cmStrCat(
"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`",
- effStandard));
+ effStandard, '.'));
} break;
case cmGeneratorTarget::Cxx20SupportLevel::MissingRule: {
this->Makefile->IssueMessage(
MessageType::FATAL_ERROR,
cmStrCat("The target named \"", this->GetName(),
- "\" has C++ sources that use modules but the compiler does "
- "not provide a way to discover the import graph "
- "dependencies"));
+ "\" has C++ sources that may use modules, but 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."));
} break;
case cmGeneratorTarget::Cxx20SupportLevel::Supported:
// All is well.
diff --git a/Tests/RunCMake/CXXModules/CMP0155-NEW-stderr.txt b/Tests/RunCMake/CXXModules/CMP0155-NEW-stderr.txt
index 39575d4..0843d0b 100644
--- a/Tests/RunCMake/CXXModules/CMP0155-NEW-stderr.txt
+++ b/Tests/RunCMake/CXXModules/CMP0155-NEW-stderr.txt
@@ -1,8 +1,10 @@
(CMake Error in CMakeLists.txt:
-( The target named "cmp0155-new" has C\+\+ sources that use modules but the
- compiler does not provide a way to discover the import graph dependencies
-| The target named "cmp0155-new" contains C\+\+ sources that use modules which
- is not supported by the generator
+ The target named "cmp0155-new" has C\+\+ sources that may use modules, but
+ 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:
+ The target named "cmp0155-new" has C\+\+ sources that may use modules, but
+ modules are not supported by this generator\. See the cmake-cxxmodules\(7\)
+ manual and the CMAKE_CXX_SCAN_FOR_MODULES variable\.
)
-)*
-CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt
index da65c26..ba2715b 100644
--- a/Tests/RunCMake/CXXModules/NoCXX-stderr.txt
+++ b/Tests/RunCMake/CXXModules/NoCXX-stderr.txt
@@ -1,13 +1,15 @@
(CMake Error in CMakeLists.txt:
-( The target named "nocxx" has C\+\+ sources that use modules but the "CXX"
- language has not been enabled
-| The target named "nocxx" contains C\+\+ sources that use modules which is not
- supported by the generator
-| Target "nocxx" has source file
+ The target named "nocxx" has C\+\+ sources that use modules, but the "CXX"
+ language has not been enabled\.
+|CMake Error in CMakeLists.txt:
+ The target named "nocxx" has C\+\+ sources that may use modules, but modules
+ 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:
+ Target "nocxx" has source file
- .*/Tests/RunCMake/CXXModules/sources/module.cxx
+ [^
+]*/Tests/RunCMake/CXXModules/sources/module.cxx
in a "FILE_SET TYPE CXX_MODULES" but it is not scheduled for compilation.
)
-)*
-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 5a9b6e7..3f3a547 100644
--- a/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt
+++ b/Tests/RunCMake/CXXModules/NoCXX20-stderr.txt
@@ -1,9 +1,9 @@
(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
- "cxx_std_17"
-| The target named "nocxx20" contains C\+\+ sources that use modules which is
- not supported by the generator
+ "cxx_std_17"\.
+|CMake Error in CMakeLists.txt:
+ The target named "nocxx20" has C\+\+ sources that may use modules, but
+ modules are not supported by this generator\. See the cmake-cxxmodules\(7\)
+ manual and the CMAKE_CXX_SCAN_FOR_MODULES variable\.
)
-)*
-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 6a9c995..c7e2979 100644
--- a/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt
+++ b/Tests/RunCMake/CXXModules/NoDyndepSupport-stderr.txt
@@ -1,18 +1,12 @@
-(CMake Error:
+^(CMake Error:
The Ninja generator does not support C\+\+20 modules using Ninja version
- .*
-
- 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:
- The target named "nodyndep" contains C\+\+ sources that use modules which is
- not supported by the generator
-
-(
-CMake Error in CMakeLists.txt:
- The target named "nodyndep" contains C\+\+ sources that use modules which is
- not supported by the generator
-
-)*)
-CMake Generate step failed. Build files cannot be regenerated correctly.
+ The target named "nodyndep" has C\+\+ sources that may use modules, but
+ modules are not supported by this generator\. See the cmake-cxxmodules\(7\)
+ manual and the CMAKE_CXX_SCAN_FOR_MODULES variable\.
+)
diff --git a/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-stderr.txt b/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-stderr.txt
index 464627c..ed78672 100644
--- a/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-stderr.txt
+++ b/Tests/RunCMake/CXXModules/NoScanningSourceFileProperty-stderr.txt
@@ -1,9 +1,10 @@
(CMake Error in CMakeLists.txt:
-( The target named "noscanning-sf-property" has C\+\+ sources that use modules
- but the compiler does not provide a way to discover the import graph
- dependencies
-| The target named "noscanning-sf-property" contains C\+\+ sources that use modules which
- is not supported by the generator
+ The target named "noscanning-sf-property" has C\+\+ sources that may use
+ modules, but 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:
+ The target named "noscanning-sf-property" has C\+\+ sources that may use
+ modules, but modules are not supported by this generator\. See the
+ cmake-cxxmodules\(7\) manual and the CMAKE_CXX_SCAN_FOR_MODULES variable\.
)
-)*
-CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/CXXModules/NoScanningTargetProperty-stderr.txt b/Tests/RunCMake/CXXModules/NoScanningTargetProperty-stderr.txt
index 72c7a0a..9dfb3e9 100644
--- a/Tests/RunCMake/CXXModules/NoScanningTargetProperty-stderr.txt
+++ b/Tests/RunCMake/CXXModules/NoScanningTargetProperty-stderr.txt
@@ -1,9 +1,10 @@
(CMake Error in CMakeLists.txt:
-( The target named "noscanning-target-property" has C\+\+ sources that use
- modules but the compiler does not provide a way to discover the import
- graph dependencies
-| The target named "noscanning-target-property" contains C\+\+ sources that use modules which
- is not supported by the generator
+ 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
+ graph dependencies\. See the cmake-cxxmodules\(7\) manual and the
+ CMAKE_CXX_SCAN_FOR_MODULES variable\.
+|CMake Error in CMakeLists.txt:
+ The target named "noscanning-target-property" has C\+\+ sources that may use
+ modules, but modules are not supported by this generator\. See the
+ cmake-cxxmodules\(7\) manual and the CMAKE_CXX_SCAN_FOR_MODULES variable\.
)
-)*
-CMake Generate step failed. Build files cannot be regenerated correctly.