aboutsummaryrefslogtreecommitdiff
path: root/toolsrc
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-11-25 15:53:32 -0800
committerRobert Schumacher <roschuma@microsoft.com>2017-11-25 16:21:54 -0800
commit14cbe496bcc136aac590f10d79848ec224088e85 (patch)
tree20b3fb94bfde3588b8d43221e300335466e70598 /toolsrc
parent5335d17f53d491d83d98e80ab0e750ec0f6f430b (diff)
downloadvcpkg-14cbe496bcc136aac590f10d79848ec224088e85.tar.gz
vcpkg-14cbe496bcc136aac590f10d79848ec224088e85.zip
[vcpkg] Allow compilation inside WSL
Diffstat (limited to 'toolsrc')
-rw-r--r--toolsrc/CMakeLists.txt14
-rw-r--r--toolsrc/src/vcpkg/vcpkgpaths.cpp8
2 files changed, 22 insertions, 0 deletions
diff --git a/toolsrc/CMakeLists.txt b/toolsrc/CMakeLists.txt
new file mode 100644
index 000000000..af281f12f
--- /dev/null
+++ b/toolsrc/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.3)
+project(vcpkg CXX)
+
+add_compile_options(-std=c++1z)
+
+file(GLOB_RECURSE VCPKGLIB_SOURCES src/vcpkg/*.cpp)
+
+add_library(vcpkglib STATIC ${VCPKGLIB_SOURCES})
+target_compile_definitions(vcpkglib PRIVATE -DDISABLE_METRICS=0)
+target_include_directories(vcpkglib PUBLIC include)
+target_link_libraries(vcpkglib PRIVATE stdc++fs)
+
+add_executable(vcpkg src/vcpkg.cpp)
+target_link_libraries(vcpkg PRIVATE vcpkglib)
diff --git a/toolsrc/src/vcpkg/vcpkgpaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp
index 0114b51b8..016f26f6d 100644
--- a/toolsrc/src/vcpkg/vcpkgpaths.cpp
+++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp
@@ -113,7 +113,11 @@ namespace vcpkg
static fs::path get_cmake_path(const fs::path& downloads_folder, const fs::path& scripts_folder)
{
+#if defined(_WIN32)
static constexpr std::array<int, 3> EXPECTED_VERSION = {3, 9, 5};
+#else
+ static constexpr std::array<int, 3> EXPECTED_VERSION = {3, 5, 1};
+#endif
static const std::string VERSION_CHECK_ARGUMENTS = "--version";
const std::vector<fs::path> from_path = Files::find_from_PATH("cmake");
@@ -161,7 +165,11 @@ namespace vcpkg
fs::path get_git_path(const fs::path& downloads_folder, const fs::path& scripts_folder)
{
+#if defined(_WIN32)
static constexpr std::array<int, 3> EXPECTED_VERSION = {2, 15, 0};
+#else
+ static constexpr std::array<int, 3> EXPECTED_VERSION = {2, 7, 4};
+#endif
static const std::string VERSION_CHECK_ARGUMENTS = "--version";
const std::vector<fs::path> from_path = Files::find_from_PATH("git");