Added support for VS2013 build chain tools.
MODIFY
include/VcpkgPaths.h
include/VcpkgPaths.h
@@ -60,7 +60,7 @@ namespace vcpkg
/// <summary>Retrieve a toolset matching a VS version</summary>
/// <remarks>
- /// Valid version strings are "v140", "v141", and "". Empty string gets the latest.
+ /// Valid version strings are "v120", "v140", "v141", and "". Empty string gets the latest.
/// </remarks>
const Toolset& get_toolset(const std::string& toolset_version) const;

MODIFY
src/PostBuildLint.cpp
src/PostBuildLint.cpp
@@ -45,8 +45,8 @@ namespace vcpkg::PostBuildLint
{"msvcp100d.dll", R"(msvcp100d\.dll)"},
{"msvcp110.dll", R"(msvcp110\.dll)"},
{"msvcp110_win.dll", R"(msvcp110_win\.dll)"},
- {"msvcp120.dll", R"(msvcp120\.dll)"},
- {"msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"},
+ //{"msvcp120.dll", R"(msvcp120\.dll)"},
+ //{"msvcp120_clr0400.dll", R"(msvcp120_clr0400\.dll)"},
{"msvcp60.dll", R"(msvcp60\.dll)"},
{"msvcp60.dll", R"(msvcp60\.dll)"},
@@ -54,8 +54,8 @@ namespace vcpkg::PostBuildLint
{"msvcr100d.dll", R"(msvcr100d\.dll)"},
{"msvcr100_clr0400.dll", R"(msvcr100_clr0400\.dll)"},
{"msvcr110.dll", R"(msvcr110\.dll)"},
- {"msvcr120.dll", R"(msvcr120\.dll)"},
- {"msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"},
+ //{"msvcr120.dll", R"(msvcr120\.dll)"},
+ //{"msvcr120_clr0400.dll", R"(msvcr120_clr0400\.dll)"},
{"msvcrt20.dll", R"(msvcrt20\.dll)"},
{"msvcrt40.dll", R"(msvcrt40\.dll)"}};

MODIFY
src/VcpkgPaths.cpp
src/VcpkgPaths.cpp
@@ -269,18 +269,65 @@ 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)
{
using CPU = System::CPUArchitecture;
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";

- Added support for VS2013 build chain tools.