aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-02-26 18:18:43 -0800
committerRobert Schumacher <roschuma@microsoft.com>2018-02-26 18:18:43 -0800
commite2980c8f91327614f24abec6704a5831d8074a8a (patch)
treedbfee9c09fb1f64a1216dd46615c1fddad210cd8 /toolsrc/src
parentebdb41039450383ec7f41bd5f589cc46b7fd6a59 (diff)
downloadvcpkg-e2980c8f91327614f24abec6704a5831d8074a8a.tar.gz
vcpkg-e2980c8f91327614f24abec6704a5831d8074a8a.zip
[vcpkg] Add 7zip internal tool
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg/vcpkgpaths.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp
index bf231cecd..f2b39c110 100644
--- a/toolsrc/src/vcpkg/vcpkgpaths.cpp
+++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp
@@ -205,6 +205,20 @@ namespace vcpkg
return fetch_tool(paths.scripts, "cmake", TOOL_DATA);
}
+ static fs::path get_7za_path(const VcpkgPaths& paths)
+ {
+#if defined(_WIN32)
+ static const ToolData TOOL_DATA = parse_tool_data_from_xml(paths, "7zip");
+ if (!paths.get_filesystem().exists(TOOL_DATA.downloaded_exe_path))
+ {
+ return fetch_tool(paths.scripts, "7zip", TOOL_DATA);
+ }
+ return TOOL_DATA.downloaded_exe_path;
+#else
+ Checks::exit_with_message(VCPKG_LINE_INFO, "Cannot download 7zip for non-Windows platforms.");
+#endif
+ }
+
static fs::path get_nuget_path(const VcpkgPaths& paths)
{
static const ToolData TOOL_DATA = parse_tool_data_from_xml(paths, "nuget");
@@ -353,6 +367,11 @@ namespace vcpkg
return it != this->get_available_triplets().cend();
}
+ const fs::path& VcpkgPaths::get_7za_exe() const
+ {
+ return this->_7za_exe.get_lazy([this]() { return get_7za_path(*this); });
+ }
+
const fs::path& VcpkgPaths::get_cmake_exe() const
{
return this->cmake_exe.get_lazy([this]() { return get_cmake_path(*this); });