diff options
| author | Zephyron <zephyron@citron-emu.org> | 2025-03-17 12:26:35 +1000 |
|---|---|---|
| committer | Mike Lothian <mike@fireburn.co.uk> | 2025-05-12 12:46:19 +0100 |
| commit | b5524254f4aef7295d8b2526b5c21ca1af748505 (patch) | |
| tree | c343b0744788eb11783d1866c23ad04bfd159076 | |
| parent | db56982a8db27b55c99e5ffe199ede291e1ff15a (diff) | |
feat(build): Add host system detection for Android cross-compilation
- Modify CMakeLists.txt to detect whether the host system is Windows or Linux
- Set VCPKG_HOST_TRIPLET dynamically to either "x64-windows" or "x64-linux" based on CMAKE_HOST_SYSTEM_NAME
- Previously, the host triplet was hardcoded to "x64-windows", which prevented proper building on Linux hosts
Signed-off-by: Zephyron <zephyron@citron-emu.org>
| -rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c69806af..10739f311 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,11 +138,23 @@ if (YUZU_USE_BUNDLED_VCPKG) if (CMAKE_ANDROID_ARCH_ABI STREQUAL "arm64-v8a") set(VCPKG_TARGET_TRIPLET "arm64-android") + # Detect host system (Windows or Linux) + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + set(VCPKG_HOST_TRIPLET "x64-windows") + else() + set(VCPKG_HOST_TRIPLET "x64-linux") + endif() # this is to avoid CMake using the host pkg-config to find the host # libraries when building for Android targets set(PKG_CONFIG_EXECUTABLE "aarch64-none-linux-android-pkg-config" CACHE FILEPATH "" FORCE) elseif (CMAKE_ANDROID_ARCH_ABI STREQUAL "x86_64") set(VCPKG_TARGET_TRIPLET "x64-android") + # Detect host system (Windows or Linux) + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + set(VCPKG_HOST_TRIPLET "x64-windows") + else() + set(VCPKG_HOST_TRIPLET "x64-linux") + endif() set(PKG_CONFIG_EXECUTABLE "x86_64-none-linux-android-pkg-config" CACHE FILEPATH "" FORCE) else() message(FATAL_ERROR "Unsupported Android architecture ${CMAKE_ANDROID_ARCH_ABI}") |
