summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx18
-rw-r--r--Templates/MSBuild/FlagTables/v142_CL.json8
2 files changed, 18 insertions, 8 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 6ce82f4..fc2665b 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -1361,8 +1361,6 @@ static unsigned int cmLoadFlagTableSpecial(Json::Value entry,
namespace {
-std::string const vsVer16_10_0 = "16.10.31321.278";
-
cmIDEFlagTable const* cmLoadFlagTableJson(std::string const& flagJsonPath,
cm::optional<std::string> vsVer)
{
@@ -1380,18 +1378,22 @@ cmIDEFlagTable const* cmLoadFlagTableJson(std::string const& flagJsonPath,
if (reader.parse(stream, flags, false) && flags.isArray()) {
std::vector<cmIDEFlagTable> flagTable;
for (auto const& flag : flags) {
+ Json::Value const& vsminJson = flag["vsmin"];
+ if (vsminJson.isString()) {
+ std::string const& vsmin = vsminJson.asString();
+ if (!vsmin.empty()) {
+ if (!vsVer ||
+ cmSystemTools::VersionCompareGreater(vsmin, *vsVer)) {
+ continue;
+ }
+ }
+ }
cmIDEFlagTable flagEntry;
flagEntry.IDEName = cmLoadFlagTableString(flag, "name");
flagEntry.commandFlag = cmLoadFlagTableString(flag, "switch");
flagEntry.comment = cmLoadFlagTableString(flag, "comment");
flagEntry.value = cmLoadFlagTableString(flag, "value");
flagEntry.special = cmLoadFlagTableSpecial(flag, "flags");
- // FIXME: Port this version check to a Json field.
- if (vsVer &&
- !cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer16_10_0) &&
- flagEntry.IDEName == "ExternalWarningLevel") {
- continue;
- }
flagTable.push_back(flagEntry);
}
cmIDEFlagTable endFlag{ "", "", "", "", 0 };
diff --git a/Templates/MSBuild/FlagTables/v142_CL.json b/Templates/MSBuild/FlagTables/v142_CL.json
index 650ff6c..c21a3de 100644
--- a/Templates/MSBuild/FlagTables/v142_CL.json
+++ b/Templates/MSBuild/FlagTables/v142_CL.json
@@ -572,6 +572,7 @@
"switch": "external:W0",
"comment": "Turn Off All Warnings",
"value": "TurnOffAllWarnings",
+ "vsmin": "16.10.31321.278",
"flags": []
},
{
@@ -579,6 +580,7 @@
"switch": "external:W1",
"comment": "Level1",
"value": "Level1",
+ "vsmin": "16.10.31321.278",
"flags": []
},
{
@@ -586,6 +588,7 @@
"switch": "external:W2",
"comment": "Level2",
"value": "Level2",
+ "vsmin": "16.10.31321.278",
"flags": []
},
{
@@ -593,6 +596,7 @@
"switch": "external:W3",
"comment": "Level3",
"value": "Level3",
+ "vsmin": "16.10.31321.278",
"flags": []
},
{
@@ -600,6 +604,7 @@
"switch": "external:W4",
"comment": "Level4",
"value": "Level4",
+ "vsmin": "16.10.31321.278",
"flags": []
},
{
@@ -1141,6 +1146,7 @@
"switch": "external:anglebrackets",
"comment": "Treat Files Included with Angle Brackets as External",
"value": "true",
+ "vsmin": "16.10.31321.278",
"flags": []
},
{
@@ -1148,6 +1154,7 @@
"switch": "external:templates-",
"comment": "Template Diagnostics in External Headers",
"value": "true",
+ "vsmin": "16.10.31321.278",
"flags": []
},
{
@@ -1277,6 +1284,7 @@
"switch": "external:env:",
"comment": "External Directories Environment Variables",
"value": "",
+ "vsmin": "16.10.31321.278",
"flags": [
"UserValue",
"SemicolonAppendable"