cmVisualStudio10TargetGenerator: always specify scanning

Set that sources should not be scanned on a target-wide basis and then
enable on a per-TU basis as needed.

Fixes: #25519
This commit is contained in:
Ben Boeckel
2023-12-26 11:43:03 -05:00
parent 6c9614cbf4
commit 029ddc3410
+4 -3
View File
@@ -2827,7 +2827,7 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
// use them
if (!flags.empty() || !options.empty() || !configDefines.empty() ||
!includes.empty() || compileAsPerConfig || noWinRT ||
!options.empty() || needsPCHFlags) {
!options.empty() || needsPCHFlags || shouldScanForModules) {
cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
cmIDEFlagTable const* flagtable = nullptr;
const std::string& srclang = source->GetLanguage();
@@ -2857,8 +2857,6 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
}
if (shouldScanForModules) {
clOptions.AddFlag("ScanSourceForModuleDependencies", "true");
} else {
clOptions.AddFlag("ScanSourceForModuleDependencies", "false");
}
if (noWinRT) {
clOptions.AddFlag("CompileAsWinRT", "false");
@@ -3564,6 +3562,9 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
e2.Element("AdditionalUsingDirectories", dirs);
}
}
// Disable C++ source scanning by default.
e2.Element("ScanSourceForModuleDependencies", "false");
}
bool cmVisualStudio10TargetGenerator::ComputeRcOptions()