diff options
author | Brad King <brad.king@kitware.com> | 2021-06-18 13:38:20 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-06-18 13:38:26 (GMT) |
commit | 333e1973cebaff2bf3158d237c24763b91e1ad65 (patch) | |
tree | 3e64ad46d77da521442f07c8971d5c50c4c62249 /Source/cmGlobalVisualStudio10Generator.cxx | |
parent | efc3e25790354383eca1e06c65ca71a7e093abb5 (diff) | |
parent | b0f830ced6552b055bc73de470a4631aa3a14430 (diff) | |
download | CMake-333e1973cebaff2bf3158d237c24763b91e1ad65.zip CMake-333e1973cebaff2bf3158d237c24763b91e1ad65.tar.gz CMake-333e1973cebaff2bf3158d237c24763b91e1ad65.tar.bz2 |
Merge topic 'vs-flag-tables' into release-3.21
b0f830ced6 VS: Do not apply any '/external:*' flag table mapping on VS < 16.10
3fd65f5ca6 VS: Compare VS instance versions as strings
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6241
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index fa51092..fc2665b 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -1361,10 +1361,8 @@ static unsigned int cmLoadFlagTableSpecial(Json::Value entry, namespace { -unsigned long long const vsVer16_10_0 = 4503644629696790; - -cmIDEFlagTable const* cmLoadFlagTableJson( - std::string const& flagJsonPath, cm::optional<unsigned long long> vsver) +cmIDEFlagTable const* cmLoadFlagTableJson(std::string const& flagJsonPath, + cm::optional<std::string> vsVer) { cmIDEFlagTable* ret = nullptr; auto savedFlagIterator = loadedFlagJsonFiles.find(flagJsonPath); @@ -1380,17 +1378,22 @@ cmIDEFlagTable const* cmLoadFlagTableJson( 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 && *vsver < vsVer16_10_0 && - flagEntry.IDEName == "ExternalWarningLevel") { - continue; - } flagTable.push_back(flagEntry); } cmIDEFlagTable endFlag{ "", "", "", "", 0 }; @@ -1466,8 +1469,8 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::LoadFlagTable( } } - cm::optional<unsigned long long> vsver = this->GetVSInstanceVersion(); - if (cmIDEFlagTable const* ret = cmLoadFlagTableJson(filename, vsver)) { + cm::optional<std::string> vsVer = this->GetVSInstanceVersion(); + if (cmIDEFlagTable const* ret = cmLoadFlagTableJson(filename, vsVer)) { return ret; } |