diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2019-01-25 18:11:08 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2019-01-30 14:27:10 -0800 |
| commit | 660745956a59f58bc95b1802b2d08ddaeff37eb7 (patch) | |
| tree | 7154e73e0017c6df8785c905d66cf9109ef55aff /toolsrc | |
| parent | fd56ffcf5c9a7ace36c8d4e0dc9785605b0fbd45 (diff) | |
| download | vcpkg-660745956a59f58bc95b1802b2d08ddaeff37eb7.tar.gz vcpkg-660745956a59f58bc95b1802b2d08ddaeff37eb7.zip | |
[boost][python3] Fix building with VS 2019
Diffstat (limited to 'toolsrc')
| -rw-r--r-- | toolsrc/src/vcpkg/visualstudio.cpp | 54 |
1 files changed, 41 insertions, 13 deletions
diff --git a/toolsrc/src/vcpkg/visualstudio.cpp b/toolsrc/src/vcpkg/visualstudio.cpp index 83a530a10..d2fccc716 100644 --- a/toolsrc/src/vcpkg/visualstudio.cpp +++ b/toolsrc/src/vcpkg/visualstudio.cpp @@ -12,6 +12,7 @@ namespace vcpkg::VisualStudio static constexpr CStringView V_120 = "v120"; static constexpr CStringView V_140 = "v140"; static constexpr CStringView V_141 = "v141"; + static constexpr CStringView V_142 = "v142"; struct VisualStudioInstance { @@ -213,35 +214,62 @@ namespace vcpkg::VisualStudio for (const fs::path& subdir : msvc_subdirectories) { + auto toolset_version_full = subdir.filename().u8string(); + auto toolset_version_prefix = toolset_version_full.substr(0, 4); + CStringView toolset_version; + std::string vcvars_option; + if (toolset_version_prefix.size() != 4) + { + // unknown toolset + continue; + } + else if (toolset_version_prefix[3] == '1') + { + toolset_version = V_141; + vcvars_option = "-vcvars_ver=14.1"; + } + else if (toolset_version_prefix[3] == '2') + { + toolset_version = V_142; + vcvars_option = "-vcvars_ver=14.2"; + } + else + { + // unknown toolset minor version + continue; + } const fs::path dumpbin_path = subdir / "bin" / "HostX86" / "x86" / "dumpbin.exe"; paths_examined.push_back(dumpbin_path); if (fs.exists(dumpbin_path)) { - const Toolset v141_toolset{ - vs_instance.root_path, dumpbin_path, vcvarsall_bat, {}, V_141, supported_architectures}; + Toolset toolset{vs_instance.root_path, + dumpbin_path, + vcvarsall_bat, + {vcvars_option}, + toolset_version, + supported_architectures}; const auto english_language_pack = dumpbin_path.parent_path() / "1033"; if (!fs.exists(english_language_pack)) { - excluded_toolsets.push_back(v141_toolset); - break; + excluded_toolsets.push_back(std::move(toolset)); + continue; } - found_toolsets.push_back(v141_toolset); + found_toolsets.push_back(std::move(toolset)); if (v140_is_available) { - const Toolset v140_toolset{vs_instance.root_path, - dumpbin_path, - vcvarsall_bat, - {"-vcvars_ver=14.0"}, - V_140, - supported_architectures}; - found_toolsets.push_back(v140_toolset); + found_toolsets.push_back({vs_instance.root_path, + dumpbin_path, + vcvarsall_bat, + {"-vcvars_ver=14.0"}, + V_140, + supported_architectures}); } - break; + continue; } } |
