VS: Explicitly disallow C++ modules provided by imported targets

The `-ifcOnly` flag is understood by MSBuild, but there are unresolved
questions about how to integrate with with CMake's model.

See: #25328
This commit is contained in:
Ben Boeckel
2023-10-16 15:42:21 -04:00
parent 7080b4ae83
commit badb6ab120
2 changed files with 10 additions and 0 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);
}