diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-10-05 13:51:28 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-10-05 18:27:07 -0700 |
| commit | 9a963f7eff1981d4e894ea8b297d092cda60b764 (patch) | |
| tree | ab7da468d01a9e4e18dbbd84aa7f6597695700c1 /toolsrc/include | |
| parent | 7f68aa6630f96f474e85cd332dbbdc1ce6226d50 (diff) | |
| download | vcpkg-9a963f7eff1981d4e894ea8b297d092cda60b764.tar.gz vcpkg-9a963f7eff1981d4e894ea8b297d092cda60b764.zip | |
Overhaul VS selection. Add triplet option to specify VS instance
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/VcpkgPaths.h | 5 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Build.h | 3 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Util.h | 15 |
3 files changed, 20 insertions, 3 deletions
diff --git a/toolsrc/include/VcpkgPaths.h b/toolsrc/include/VcpkgPaths.h index 4b4527434..d4640fba2 100644 --- a/toolsrc/include/VcpkgPaths.h +++ b/toolsrc/include/VcpkgPaths.h @@ -17,6 +17,7 @@ namespace vcpkg struct Toolset { + fs::path visual_studio_root_path; fs::path dumpbin; fs::path vcvarsall; std::vector<std::wstring> vcvarsall_options; @@ -66,7 +67,8 @@ namespace vcpkg /// <remarks> /// Valid version strings are "v140", "v141", and "". Empty string gets the latest. /// </remarks> - const Toolset& get_toolset(const std::string& toolset_version) const; + const Toolset& VcpkgPaths::get_toolset(const Optional<std::string>& toolset_version, + const Optional<fs::path>& visual_studio_path) const; Files::Filesystem& get_filesystem() const; @@ -78,6 +80,5 @@ namespace vcpkg Lazy<fs::path> ifw_binarycreator_exe; Lazy<fs::path> ifw_repogen_exe; Lazy<std::vector<Toolset>> toolsets; - Lazy<std::vector<Toolset>> toolsets_vs2017_v140; }; } diff --git a/toolsrc/include/vcpkg_Build.h b/toolsrc/include/vcpkg_Build.h index 78e89d4de..5ba675757 100644 --- a/toolsrc/include/vcpkg_Build.h +++ b/toolsrc/include/vcpkg_Build.h @@ -79,7 +79,8 @@ namespace vcpkg::Build std::string target_architecture; std::string cmake_system_name; std::string cmake_system_version; - std::string platform_toolset; + Optional<std::string> platform_toolset; + Optional<fs::path> visual_studio_path; }; std::wstring make_build_env_cmd(const PreBuildInfo& pre_build_info, const Toolset& toolset); diff --git a/toolsrc/include/vcpkg_Util.h b/toolsrc/include/vcpkg_Util.h index e5ead6d3a..a87045d73 100644 --- a/toolsrc/include/vcpkg_Util.h +++ b/toolsrc/include/vcpkg_Util.h @@ -67,6 +67,21 @@ namespace vcpkg::Util return std::find_if(cont.cbegin(), cont.cend(), pred); } + template<class Container> + using ToVectorOfConstPointersT = std::decay_t<decltype(*std::begin(std::declval<Container>()))>; + + template<class Container, class T = ToVectorOfConstPointersT<Container>> + std::vector<const T*> to_vector_of_const_pointers(const Container& cont) + { + std::vector<const T*> output; + for (auto i = cont.cbegin(), cend = cont.end(); i != cend; ++i) + { + output.push_back(&(*i)); + } + + return output; + } + template<class Container, class Pred> auto find_if_not(const Container& cont, Pred pred) { |
