Auto-setup: Force lowercase triplet for vcpkg

The error that vcpkg reports for ARM64 for example:

> error: Invalid triplet name. Triplet names are all lowercase
alphanumeric+hyphens.

This can happen on Windows Arm64.

Change-Id: I53c134e071b001ba431783361fc2b8ba977ece99
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2025-04-24 18:56:43 +02:00
parent 7b3886d22e
commit ed7191e58f

View File

@@ -319,7 +319,8 @@ macro(qtc_auto_setup_vcpkg)
elseif (WIN32)
set(vcpkg_triplet x64-mingw-static)
if (CMAKE_CXX_COMPILER MATCHES ".*/(.*)/cl.exe")
set(vcpkg_triplet ${CMAKE_MATCH_1}-windows)
string(TOLOWER ${CMAKE_MATCH_1} host_arch_lowercase)
set(vcpkg_triplet ${host_arch_lowercase}-windows)
endif()
elseif(APPLE)
# We're too early to use CMAKE_HOST_SYSTEM_PROCESSOR