aboutsummaryrefslogtreecommitdiff
path: root/scripts
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 /scripts
parent5335d17f53d491d83d98e80ab0e750ec0f6f430b (diff)
downloadvcpkg-14cbe496bcc136aac590f10d79848ec224088e85.tar.gz
vcpkg-14cbe496bcc136aac590f10d79848ec224088e85.zip
[vcpkg] Allow compilation inside WSL
Diffstat (limited to 'scripts')
-rw-r--r--scripts/buildsystems/vcpkg.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake
index 4d82c43b7..8edc2830c 100644
--- a/scripts/buildsystems/vcpkg.cmake
+++ b/scripts/buildsystems/vcpkg.cmake
@@ -42,6 +42,8 @@ else()
set(_VCPKG_TARGET_TRIPLET_ARCH arm)
elseif(_VCPKG_CL MATCHES "bin/cl.exe$" OR _VCPKG_CL MATCHES "x86/cl.exe$")
set(_VCPKG_TARGET_TRIPLET_ARCH x86)
+ elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ set(_VCPKG_TARGET_TRIPLET_ARCH x64)
else()
message(FATAL_ERROR "Unable to determine target architecture.")
endif()
@@ -50,6 +52,8 @@ endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
set(_VCPKG_TARGET_TRIPLET_PLAT uwp)
+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+ set(_VCPKG_TARGET_TRIPLET_PLAT linux)
else()
set(_VCPKG_TARGET_TRIPLET_PLAT windows)
endif()
@@ -93,7 +97,7 @@ list(APPEND CMAKE_LIBRARY_PATH
set(Boost_COMPILER "-vc140")
-if (NOT DEFINED CMAKE_SYSTEM_VERSION)
+if (NOT DEFINED CMAKE_SYSTEM_VERSION AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp")
include(${_VCPKG_ROOT_DIR}/scripts/cmake/vcpkg_get_windows_sdk.cmake)
# This is used as an implicit parameter for vcpkg_get_windows_sdk
set(VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR})
@@ -134,7 +138,7 @@ function(add_executable name)
list(FIND ARGV "IMPORTED" IMPORTED_IDX)
list(FIND ARGV "ALIAS" ALIAS_IDX)
if(IMPORTED_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1)
- if(VCPKG_APPLOCAL_DEPS)
+ if(VCPKG_APPLOCAL_DEPS AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp")
add_custom_command(TARGET ${name} POST_BUILD
COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1
-targetBinary $<TARGET_FILE:${name}>