build: fix using host pkgconf for ARM64 cross bld
Set `VCPKG_HOST_TRIPLET` and `VCPKG_USE_HOST_TOOLS` when using an X64 host for an ARM64 cross build in order to use the host `pkgconf` and possibly other tools. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
c8a4f66cf8
commit
557f897ead
|
@ -10,19 +10,28 @@ if(NOT DEFINED VCPKG_TARGET_TRIPLET)
|
||||||
# Check if we are in an MSVC environment.
|
# Check if we are in an MSVC environment.
|
||||||
find_program(cl_exe_path NAME cl.exe HINTS ENV PATH)
|
find_program(cl_exe_path NAME cl.exe HINTS ENV PATH)
|
||||||
|
|
||||||
if($ENV{CXX} MATCHES "cl.exe$" OR cl_exe_path)
|
if(ENV{CXX} MATCHES "cl.exe$" OR cl_exe_path)
|
||||||
# Infer the architecture from the LIB folders.
|
# Infer the architecture from the LIB folders.
|
||||||
foreach(LIB $ENV{LIB})
|
foreach(lib $ENV{LIB})
|
||||||
if(${LIB} MATCHES "x64$")
|
if(lib MATCHES "x64$")
|
||||||
set(VBAM_VCPKG_PLATFORM "x64-windows-static")
|
set(VBAM_VCPKG_PLATFORM "x64-windows-static")
|
||||||
break()
|
break()
|
||||||
endif()
|
endif()
|
||||||
if(${LIB} MATCHES "x86$")
|
if(lib MATCHES "x86$")
|
||||||
set(VBAM_VCPKG_PLATFORM "x86-windows-static")
|
set(VBAM_VCPKG_PLATFORM "x86-windows-static")
|
||||||
break()
|
break()
|
||||||
endif()
|
endif()
|
||||||
if(${LIB} MATCHES "ARM64$")
|
if(lib MATCHES "ARM64$")
|
||||||
set(VBAM_VCPKG_PLATFORM "arm64-windows-static")
|
set(VBAM_VCPKG_PLATFORM "arm64-windows-static")
|
||||||
|
|
||||||
|
foreach(path $ENV{PATH})
|
||||||
|
if(path MATCHES "[Hh]ost[Xx]64")
|
||||||
|
set(VCPKG_HOST_TRIPLET "x64-windows-static" CACHE STRING "Vcpkg host triplet" FORCE)
|
||||||
|
set(VCPKG_USE_HOST_TOOLS ON CACHE BOOL "Use vcpkg host tools" FORCE)
|
||||||
|
break()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
break()
|
break()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
Loading…
Reference in New Issue