mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
[vcpkg] Improve non-Windows default triplet detection
This commit is contained in:
parent
9336d5ea84
commit
7142a09344
@ -57,12 +57,14 @@ endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
|
||||
set(_VCPKG_TARGET_TRIPLET_PLAT uwp)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux"))
|
||||
set(_VCPKG_TARGET_TRIPLET_PLAT linux)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin"))
|
||||
set(_VCPKG_TARGET_TRIPLET_PLAT osx)
|
||||
else()
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows"))
|
||||
set(_VCPKG_TARGET_TRIPLET_PLAT windows)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD"))
|
||||
set(_VCPKG_TARGET_TRIPLET_PLAT freebsd)
|
||||
endif()
|
||||
|
||||
set(VCPKG_TARGET_TRIPLET ${_VCPKG_TARGET_TRIPLET_ARCH}-${_VCPKG_TARGET_TRIPLET_PLAT} CACHE STRING "Vcpkg target triplet (ex. x86-windows)")
|
||||
|
4
scripts/toolchains/freebsd.cmake
Normal file
4
scripts/toolchains/freebsd.cmake
Normal file
@ -0,0 +1,4 @@
|
||||
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "")
|
||||
endif()
|
||||
set(CMAKE_SYSTEM_NAME FreeBSD CACHE STRING "")
|
@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "")
|
||||
endif()
|
||||
|
@ -1 +1,4 @@
|
||||
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "")
|
||||
endif()
|
||||
set(CMAKE_SYSTEM_NAME Darwin CACHE STRING "")
|
||||
|
Loading…
x
Reference in New Issue
Block a user