summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmVS141CLFlagTable.h2
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx8
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmVS141CLFlagTable.h b/Source/cmVS141CLFlagTable.h
index 7d3e356..2a9944a 100644
--- a/Source/cmVS141CLFlagTable.h
+++ b/Source/cmVS141CLFlagTable.h
@@ -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",
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 16eca96..57d66e0 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -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;
}
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 829d2bf..0dc03b6 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -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;