VS: Only generate RC options if necessary

The RC options were computed and generated for every vcxproj file
before, even if no rc source was actually invocing the 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:34:16 -04:00
1 parent 29d594d95a
commit 1ec0ddf399
1 file changed
+8 -4
+8 -4
View File
@@ -4001,9 +4001,12 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
bool cmVisualStudio10TargetGenerator::ComputeRcOptions()
{
return std::all_of(
this->Configurations.begin(), this->Configurations.end(),
[this](std::string const& c) { return this->ComputeRcOptions(c); });
return std::all_of(this->Configurations.begin(), this->Configurations.end(),
[this](std::string const& c) {
return !this->GeneratorTarget->IsLanguageUsed("RC",
c) ||
this->ComputeRcOptions(c);
});
}
bool cmVisualStudio10TargetGenerator::ComputeRcOptions(
@@ -4036,7 +4039,8 @@ bool cmVisualStudio10TargetGenerator::ComputeRcOptions(
void cmVisualStudio10TargetGenerator::WriteRCOptions(
Elem& e1, std::string const& configName)
{
if (!this->MSTools) {
if (!this->MSTools ||
!this->GeneratorTarget->IsLanguageUsed("RC", configName)) {
return;
}
Elem e2(e1, "ResourceCompile");