summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-09-14 17:01:04 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-09-14 17:01:21 (GMT)
commit5b590882fa8df34ad815082c8af867698d93b93f (patch)
treecffdb03ca8878e6d500bd4d423b18840413acf85 /Source
parentc7af11b4d6fe26bcdbc67a816a999568fad8a19e (diff)
parent24a9b00f83b350eafd521570046f1cb076ea2030 (diff)
downloadCMake-5b590882fa8df34ad815082c8af867698d93b93f.zip
CMake-5b590882fa8df34ad815082c8af867698d93b93f.tar.gz
CMake-5b590882fa8df34ad815082c8af867698d93b93f.tar.bz2
Merge topic 'cxxmodules-non-compiled-source'
24a9b00f83 Merge branch 'cxxmodules-non-compiled-source-release' into cxxmodules-non-compiled-source 458e3974a8 cxxmodules: detect and message about non-compiled sources Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8773
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDyndepCollation.cxx7
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx20
2 files changed, 24 insertions, 3 deletions
diff --git a/Source/cmDyndepCollation.cxx b/Source/cmDyndepCollation.cxx
index dfab975..75f88b2 100644
--- a/Source/cmDyndepCollation.cxx
+++ b/Source/cmDyndepCollation.cxx
@@ -122,10 +122,11 @@ Json::Value CollationInformationCxxModules(
auto lookup = sf_map.find(file);
if (lookup == sf_map.end()) {
gt->Makefile->IssueMessage(
- MessageType::INTERNAL_ERROR,
- cmStrCat("Target \"", tgt->GetName(), "\" has source file \"",
+ MessageType::FATAL_ERROR,
+ cmStrCat("Target \"", tgt->GetName(), "\" has source file\n ",
file,
- R"(" which is not in any of its "FILE_SET BASE_DIRS".)"));
+ "\nin a \"FILE_SET TYPE CXX_MODULES\" but it is not "
+ "scheduled for compilation."));
continue;
}
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 96a01ad..ea4bd06 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2551,6 +2551,12 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
break;
}
+ std::string config;
+ if (!this->Configurations.empty()) {
+ config = this->Configurations[si.Configs[0]];
+ }
+ auto const* fs =
+ this->GeneratorTarget->GetFileSetForSource(config, si.Source);
if (tool) {
// Compute set of configurations to exclude, if any.
std::vector<size_t> const& include_configs = si.Configs;
@@ -2616,6 +2622,13 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
if (si.Kind == cmGeneratorTarget::SourceKindObjectSource ||
si.Kind == cmGeneratorTarget::SourceKindUnityBatched) {
this->OutputSourceSpecificFlags(e2, si.Source);
+ } else if (fs && fs->GetType() == "CXX_MODULES"_s) {
+ this->GeneratorTarget->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("Target \"", this->GeneratorTarget->GetName(),
+ "\" has source file\n ", si.Source->GetFullPath(),
+ "\nin a \"FILE_SET TYPE CXX_MODULES\" but it is not "
+ "scheduled for compilation."));
}
if (si.Source->GetPropertyAsBool("SKIP_PRECOMPILE_HEADERS")) {
e2.Element("PrecompiledHeader", "NotUsing");
@@ -2625,6 +2638,13 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
}
this->FinishWritingSource(e2, toolSettings);
+ } else if (fs && fs->GetType() == "CXX_MODULES"_s) {
+ this->GeneratorTarget->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("Target \"", this->GeneratorTarget->GetName(),
+ "\" has source file\n ", si.Source->GetFullPath(),
+ "\nin a \"FILE_SET TYPE CXX_MODULES\" but it is not "
+ "scheduled for compilation."));
}
}