VS: Only generate MASM options if necessary

The MASM options were computed and generated for every vcxproj file
before, even if no source file actually used the ASM_MASM compiler.
Now we check first if we actually need to compute these.
This commit is contained in:
John Franklin Rickard authored and Brad King committed 2026-10-26 15:33:51 -04:00
1 parent c8046c55ba
commit b07b27d57c
1 file changed
+8 -4
+8 -4
View File
@@ -4429,9 +4429,12 @@ bool cmVisualStudio10TargetGenerator::ComputeMasmOptions()
if (!this->GlobalGenerator->IsMasmEnabled()) {
return true;
}
return std::all_of(
this->Configurations.begin(), this->Configurations.end(),
[this](std::string const& c) { return this->ComputeMasmOptions(c); });
return std::all_of(this->Configurations.begin(), this->Configurations.end(),
[this](std::string const& c) {
return !this->GeneratorTarget->IsLanguageUsed(
"ASM_MASM", c) ||
this->ComputeMasmOptions(c);
});
}
bool cmVisualStudio10TargetGenerator::ComputeMasmOptions(
@@ -4465,7 +4468,8 @@ bool cmVisualStudio10TargetGenerator::ComputeMasmOptions(
void cmVisualStudio10TargetGenerator::WriteMasmOptions(
Elem& e1, std::string const& configName)
{
if (!this->MSTools || !this->GlobalGenerator->IsMasmEnabled()) {
if (!this->MSTools || !this->GlobalGenerator->IsMasmEnabled() ||
!this->GeneratorTarget->IsLanguageUsed("ASM_MASM", configName)) {
return;
}
Elem e2(e1, "MASM");