aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/VcpkgPaths.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/VcpkgPaths.cpp')
-rw-r--r--toolsrc/src/VcpkgPaths.cpp50
1 files changed, 49 insertions, 1 deletions
diff --git a/toolsrc/src/VcpkgPaths.cpp b/toolsrc/src/VcpkgPaths.cpp
index 906a5e67f..71a35d24c 100644
--- a/toolsrc/src/VcpkgPaths.cpp
+++ b/toolsrc/src/VcpkgPaths.cpp
@@ -268,6 +268,19 @@ namespace vcpkg
return nullopt;
}
+
+ static Optional<fs::path> get_vs2013_installation_instance()
+ {
+ const Optional<std::wstring> vs2013_cmntools_optional = System::get_environment_variable(L"VS120COMNTOOLS");
+ if (const auto v = vs2013_cmntools_optional.get())
+ {
+ const fs::path vs2013_cmntools = fs::path(*v).parent_path(); // The call to parent_path() is needed because
+ // the env variable has a trailing backslash
+ return vs2013_cmntools.parent_path().parent_path();
+ }
+
+ return nullopt;
+ }
static std::vector<Toolset> find_toolset_instances(const VcpkgPaths& paths)
{
@@ -275,12 +288,46 @@ namespace vcpkg
const auto& fs = paths.get_filesystem();
- const std::vector<std::string> vs2017_installation_instances = get_vs2017_installation_instances(paths);
// Note: this will contain a mix of vcvarsall.bat locations and dumpbin.exe locations.
std::vector<fs::path> paths_examined;
std::vector<Toolset> found_toolsets;
+ // VS2013
+ const Optional<fs::path> vs_2013_installation_instance = get_vs2013_installation_instance();
+ if (const auto v = vs_2013_installation_instance.get())
+ {
+ const fs::path vs2013_vcvarsall_bat = *v / "VC" / "vcvarsall.bat";
+
+ paths_examined.push_back(vs2013_vcvarsall_bat);
+ if (fs.exists(vs2013_vcvarsall_bat))
+ {
+ const fs::path vs2013_dumpbin_exe = *v / "VC" / "bin" / "dumpbin.exe";
+ paths_examined.push_back(vs2013_dumpbin_exe);
+
+ const fs::path vs2013_bin_dir = vs2013_vcvarsall_bat.parent_path() / "bin";
+ std::vector<ToolsetArchOption> supported_architectures;
+ if (fs.exists(vs2013_bin_dir / "vcvars32.bat"))
+ supported_architectures.push_back({L"x86", CPU::X86, CPU::X86});
+ if (fs.exists(3 / "amd64\\vcvars64.bat"))
+ supported_architectures.push_back({L"x64", CPU::X64, CPU::X64});
+ if (fs.exists(vs2013_bin_dir / "x86_amd64\\vcvarsx86_amd64.bat"))
+ supported_architectures.push_back({L"x86_amd64", CPU::X86, CPU::X64});
+ if (fs.exists(vs2013_bin_dir / "x86_arm\\vcvarsx86_arm.bat"))
+ supported_architectures.push_back({L"x86_arm", CPU::X86, CPU::ARM});
+ if (fs.exists(vs2013_bin_dir / "amd64_x86\\vcvarsamd64_x86.bat"))
+ supported_architectures.push_back({L"amd64_x86", CPU::X64, CPU::X86});
+ if (fs.exists(vs2013_bin_dir / "amd64_arm\\vcvarsamd64_arm.bat"))
+ supported_architectures.push_back({L"amd64_arm", CPU::X64, CPU::ARM});
+
+ if (fs.exists(vs2013_dumpbin_exe))
+ {
+ found_toolsets.push_back(
+ {vs2013_dumpbin_exe, vs2013_vcvarsall_bat, L"v120", supported_architectures});
+ }
+ }
+ }
+
// VS2015
const Optional<fs::path> vs_2015_installation_instance = get_vs2015_installation_instance();
if (const auto v = vs_2015_installation_instance.get())
@@ -318,6 +365,7 @@ namespace vcpkg
// VS2017
Optional<Toolset> vs2017_toolset;
+ const std::vector<std::string> vs2017_installation_instances = get_vs2017_installation_instances(paths);
for (const std::string& instance : vs2017_installation_instances)
{
const fs::path vc_dir = fs::path{instance} / "VC";