aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg_Environment.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-01-23 15:30:04 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2017-01-23 15:30:04 -0800
commit50d5e12390636137fedc1472872a4ae777bf1b2c (patch)
tree5907047b5c1b8ec70069ab658f0cf995304d5395 /toolsrc/src/vcpkg_Environment.cpp
parent9194f36a6c3ac873ca13a4be11745968ae1e263e (diff)
downloadvcpkg-50d5e12390636137fedc1472872a4ae777bf1b2c.tar.gz
vcpkg-50d5e12390636137fedc1472872a4ae777bf1b2c.zip
[VS2017] Extract function that detects the VS2015 instance, when no VS2017 is found
Diffstat (limited to 'toolsrc/src/vcpkg_Environment.cpp')
-rw-r--r--toolsrc/src/vcpkg_Environment.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/toolsrc/src/vcpkg_Environment.cpp b/toolsrc/src/vcpkg_Environment.cpp
index 1cbd60341..00f7206e3 100644
--- a/toolsrc/src/vcpkg_Environment.cpp
+++ b/toolsrc/src/vcpkg_Environment.cpp
@@ -94,6 +94,13 @@ namespace vcpkg::Environment
return Strings::split(ec_data.output, "\n");
}
+ static const fs::path& get_VS2015_installation_instance()
+ {
+ static const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // TODO: Check why this requires parent_path() call
+ static const fs::path vs2015_path = vs2015_cmntools.parent_path().parent_path();
+ return vs2015_path;
+ }
+
static fs::path find_dumpbin_exe(const vcpkg_paths& paths)
{
const std::vector<std::string> vs2017_installation_instances = get_VS2017_installation_instances(paths);
@@ -111,8 +118,7 @@ namespace vcpkg::Environment
}
// VS2015
- const fs::path vs2015_cmntools = fs::path(System::wdupenv_str(L"VS140COMNTOOLS")).parent_path(); // TODO: Check why this requires parent_path() call
- const fs::path vs2015_dumpbin_exe = vs2015_cmntools.parent_path().parent_path() / "VC" / "bin" / "dumpbin.exe";
+ const fs::path vs2015_dumpbin_exe = get_VS2015_installation_instance() / "VC" / "bin" / "dumpbin.exe";
paths_examined.push_back(vs2015_dumpbin_exe);
if (fs::exists(vs2015_dumpbin_exe))
{