diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-09-12 18:47:20 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-09-12 18:47:20 (GMT) |
commit | 24a9b00f83b350eafd521570046f1cb076ea2030 (patch) | |
tree | 432a4f19a2b8a9a84329beebe9b2ce0246f3c138 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | b1cb23a011a8ffbcbb648abed36dc73491767ea5 (diff) | |
parent | 458e3974a8d3827f051201403a1acc4ddca3c19e (diff) | |
download | CMake-24a9b00f83b350eafd521570046f1cb076ea2030.zip CMake-24a9b00f83b350eafd521570046f1cb076ea2030.tar.gz CMake-24a9b00f83b350eafd521570046f1cb076ea2030.tar.bz2 |
Merge branch 'cxxmodules-non-compiled-source-release' into cxxmodules-non-compiled-source
* cxxmodules-non-compiled-source-release:
cxxmodules: detect and message about non-compiled sources
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 7ca23a3..702a425 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.")); } } |