Merge topic 'cxxmodules-vs-no-synthetic-targets' into release-3.28

17fd7fe2ae Tests/CXXModules: test Visual Studio synthetic target error
badb6ab120 VS: Explicitly disallow C++ modules provided by imported targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8895
This commit is contained in:
Brad King
2023-10-18 13:51:43 +00:00
committed by Kitware Robot
8 changed files with 57 additions and 1 deletions
@@ -358,6 +358,15 @@ std::ostream& cmVisualStudio10TargetGenerator::Elem::WriteString(
void cmVisualStudio10TargetGenerator::Generate()
{
if (this->GeneratorTarget->IsSynthetic()) {
this->GeneratorTarget->Makefile->IssueMessage(
MessageType::FATAL_ERROR,
cmStrCat("Target \"", this->GeneratorTarget->GetName(),
"\" contains C++ modules intended for BMI-only compilation. "
"This is not yet supported by the Visual Studio generator."));
return;
}
for (std::string const& config : this->Configurations) {
this->GeneratorTarget->CheckCxxModuleStatus(config);
}