From c167c70c272a417779e601fffcbdb72278da1848 Mon Sep 17 00:00:00 2001 From: martin-s Date: Sat, 2 Sep 2017 16:48:29 +0200 Subject: - Added support for VS2013 build chain tools. --- toolsrc/src/PostBuildLint.cpp | 8 +++---- toolsrc/src/VcpkgPaths.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 5 deletions(-) (limited to 'toolsrc/src') diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 1fd48d3ec..33dc446cf 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/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)"}}; 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 get_vs2013_installation_instance() + { + const Optional 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 find_toolset_instances(const VcpkgPaths& paths) { @@ -275,12 +288,46 @@ namespace vcpkg const auto& fs = paths.get_filesystem(); - const std::vector vs2017_installation_instances = get_vs2017_installation_instances(paths); // Note: this will contain a mix of vcvarsall.bat locations and dumpbin.exe locations. std::vector paths_examined; std::vector found_toolsets; + // VS2013 + const Optional 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 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 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 vs2017_toolset; + const std::vector 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"; -- cgit v1.2.3