aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2020-10-17 02:10:48 -0700
committerGitHub <noreply@github.com>2020-10-17 02:10:48 -0700
commitb69056ba92dd552e3c2cb30e4f7af00c5e39c361 (patch)
treecc1fd83739075b35a8b2ffaf3306199df314ac2a /scripts
parentaa0ffba768684702f04d6c397838365c3b23a053 (diff)
downloadvcpkg-b69056ba92dd552e3c2cb30e4f7af00c5e39c361.tar.gz
vcpkg-b69056ba92dd552e3c2cb30e4f7af00c5e39c361.zip
[vcpkg_common_definitions] Add macro VCPKG_HOST_IS_<target> (#13730)
* [vcpkg_common_definitions] Add macro VCPKG_HOST_IS_<target> * Update scripts/cmake/vcpkg_common_definitions.cmake
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/vcpkg_common_definitions.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake
index 8d36803ee..a39532a8a 100644
--- a/scripts/cmake/vcpkg_common_definitions.cmake
+++ b/scripts/cmake/vcpkg_common_definitions.cmake
@@ -5,6 +5,7 @@
## ## The following variables are available:
## ```cmake
## VCPKG_TARGET_IS_<target> with <target> being one of the following: WINDOWS, UWP, LINUX, OSX, ANDROID, FREEBSD. only defined if <target>
+## VCPKG_HOST_IS_<target> with <host> being one of the following: WINDOWS, LINUX, OSX, FREEBSD. only defined if <host>
## VCPKG_HOST_PATH_SEPARATOR Host specific path separator (USAGE: "<something>${VCPKG_HOST_PATH_SEPARATOR}<something>"; only use and pass variables with VCPKG_HOST_PATH_SEPARATOR within "")
## VCPKG_HOST_EXECUTABLE_SUFFIX executable suffix of the host
## VCPKG_TARGET_EXECUTABLE_SUFFIX executable suffix of the target
@@ -45,6 +46,17 @@ elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW")
set(VCPKG_TARGET_IS_MINGW 1)
endif()
+#Helper variables to identify the host system name
+if (CMAKE_HOST_WIN32)
+ set(VCPKG_HOST_IS_WINDOWS 1)
+elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
+ set(VCPKG_HOST_IS_OSX 1)
+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+ set(VCPKG_HOST_IS_LINUX 1)
+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
+ set(VCPKG_HOST_IS_FREEBSD 1)
+endif()
+
#Helper variable to identify the host path separator.
if(CMAKE_HOST_WIN32)
set(VCPKG_HOST_PATH_SEPARATOR ";")