Quellcode durchsuchen

CMake: Also set VCPKG_HOST_TRIPLET to the dynamic triplet

This avoids Fedora 41 x86_64 machines using the x64-linux triplet
when building pkg-config. Doing so without our custom linker flags
causes the build to fail.
Andrew Kaster vor 6 Monaten
Ursprung
Commit
2a16c58114
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2 1
      Meta/CMake/vcpkg/generate_vcpkg_toolchain_variables.cmake

+ 2 - 1
Meta/CMake/vcpkg/generate_vcpkg_toolchain_variables.cmake

@@ -22,7 +22,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/build-vcpkg-variables.cmake" "${EXTRA_VC
 # Munge the VCPKG_TRIPLET to correspond to the right one for our presets
 # Just make sure not to override if the developer is trying to cross-compile
 # or the developer set it manually, or if this is not the first run of CMake
-if (NOT DEFINED CACHE{VCPKG_TARGET_TRIPLET} AND NOT DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
+if (NOT DEFINED CACHE{VCPKG_TARGET_TRIPLET} AND NOT DEFINED CACHE{VCPKG_HOST_TRIPLET} AND NOT DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
     # Only tweak settings if there's custom triplets defined
     if (NOT DEFINED CACHE{VCPKG_OVERLAY_TRIPLETS})
         return()
@@ -68,4 +68,5 @@ if (NOT DEFINED CACHE{VCPKG_TARGET_TRIPLET} AND NOT DEFINED VCPKG_CHAINLOAD_TOOL
 
     message(STATUS "Determined host VCPKG_TARGET_TRIPLET: ${full_triplet}")
     set(VCPKG_TARGET_TRIPLET ${full_triplet} CACHE STRING "")
+    set(VCPKG_HOST_TRIPLET ${full_triplet} CACHE STRING "")
 endif()