mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-16 04:02:03 -06:00
VS: Add flag table entry for -Qspectre
Add special logic to map this flag to a top-level build setting instead of being in ClCompile. Fixes: #18426
This commit is contained in:
@@ -83,6 +83,8 @@ static cmVS7FlagTable cmVS141CLFlagTable[] = {
|
||||
{ "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 },
|
||||
{ "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 },
|
||||
|
||||
{ "SpectreMitigation", "Qspectre", "Spectre mitigations", "Spectre", 0 },
|
||||
|
||||
{ "LanguageStandard", "std:c++17", "ISO C++17 Standard", "stdcpp17", 0 },
|
||||
{ "LanguageStandard", "std:c++14", "ISO C++14 Standard", "stdcpp14", 0 },
|
||||
{ "LanguageStandard", "std:c++latest", "ISO C++ Latest Draft Standard",
|
||||
|
||||
@@ -1125,6 +1125,9 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
|
||||
if (this->IPOEnabledConfigurations.count(config) > 0) {
|
||||
e1.Element("WholeProgramOptimization", "true");
|
||||
}
|
||||
if (this->SpectreMitigationConfigurations.count(config) > 0) {
|
||||
e1.Element("SpectreMitigation", "Spectre");
|
||||
}
|
||||
}
|
||||
|
||||
void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
|
||||
@@ -2625,6 +2628,11 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
|
||||
}
|
||||
}
|
||||
|
||||
if (clOptions.HasFlag("SpectreMitigation")) {
|
||||
this->SpectreMitigationConfigurations.insert(configName);
|
||||
clOptions.RemoveFlag("SpectreMitigation");
|
||||
}
|
||||
|
||||
this->ClOptions[configName] = std::move(pOptions);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -205,6 +205,7 @@ private:
|
||||
unsigned int NsightTegraVersion[4];
|
||||
bool TargetCompileAsWinRT;
|
||||
std::set<std::string> IPOEnabledConfigurations;
|
||||
std::set<std::string> SpectreMitigationConfigurations;
|
||||
cmGlobalVisualStudio10Generator* const GlobalGenerator;
|
||||
cmLocalVisualStudio10Generator* const LocalGenerator;
|
||||
std::set<std::string> CSharpCustomCommandNames;
|
||||
|
||||
Reference in New Issue
Block a user