build: detect vcpkg host triplet for build deps
On Windows, detect the host triplet for vcpkg and prepend it to the triplet list to get the binary packages for vcpkg build dependencies correctly. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
7dc95076e5
commit
d1aa4eb23d
|
@ -224,10 +224,21 @@ function(get_binary_packages vcpkg_exe)
|
|||
set(binary_packages_installed FALSE PARENT_SCOPE)
|
||||
|
||||
unset(triplets)
|
||||
if(VCPKG_TARGET_TRIPLET MATCHES "^(.*)-static\$")
|
||||
list(APPEND triplets "${CMAKE_MATCH_1}")
|
||||
unset(host_triplet)
|
||||
# Determine host triplet for vcpkg build dependencies
|
||||
if(WIN32)
|
||||
if($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[Aa][Rr][Mm]64")
|
||||
set(host_triplet "arm64-windows")
|
||||
elseif($ENV{PROCESSOR_ARCHITECTURE} MATCHES "[Aa][Mm][Dd]64|[Xx]64")
|
||||
set(host_triplet "x64-windows")
|
||||
else()
|
||||
set(host_triplet "x86-windows")
|
||||
endif()
|
||||
endif()
|
||||
list(APPEND triplets "${VCPKG_TARGET_TRIPLET}")
|
||||
if(DEFINED host_triplet)
|
||||
list(APPEND triplets ${host_triplet})
|
||||
endif()
|
||||
list(APPEND triplets ${VCPKG_TARGET_TRIPLET})
|
||||
|
||||
foreach(triplet ${triplets})
|
||||
file(
|
||||
|
|
Loading…
Reference in New Issue