diff options
author | Zephyron <zephyron@citron-emu.orgq> | 2025-02-22 19:06:05 +1000 |
---|---|---|
committer | Zephyron <zephyron@citron-emu.orgq> | 2025-02-22 19:06:05 +1000 |
commit | 3bb4d97e9e188b7ff9f0ea1084b67e8acec429f6 (patch) | |
tree | 1e00351605f9c1d90ab915332371f84f4b26d3c0 | |
parent | a41f7b7a56c27ada187346454e76369219967f43 (diff) |
cmake: Optimize Android VVL download logic
Improve the Vulkan Validation Layer (VVL) download logic for Android by checking
for the final library file instead of just the zip archive. This prevents
unnecessary re-downloads and extractions when the library is already in place.
The check now looks for libVkLayer_khronos_validation.so in the final
destination path before attempting to download and extract the archive.
-rw-r--r-- | CMakeLists.txt | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4456a8a2a..542fce810 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,19 +100,23 @@ option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENAB if (ANDROID AND CITRON_DOWNLOAD_ANDROID_VVL) set(vvl_version "1.4.304.1") set(vvl_zip_file "${CMAKE_BINARY_DIR}/externals/vvl-android.zip") - if (NOT EXISTS "${vvl_zip_file}") + set(vvl_lib_path "${CMAKE_CURRENT_SOURCE_DIR}/src/android/app/src/main/jniLibs/arm64-v8a/") + set(vvl_final_lib "${vvl_lib_path}/libVkLayer_khronos_validation.so") + + if (NOT EXISTS "${vvl_final_lib}") # Download and extract validation layer release to externals directory - set(vvl_base_url "https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download") - file(DOWNLOAD "${vvl_base_url}/vulkan-sdk-${vvl_version}/android-binaries-${vvl_version}.zip" - "${vvl_zip_file}" SHOW_PROGRESS) - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${vvl_zip_file}" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals") - endif() + if (NOT EXISTS "${vvl_zip_file}") + set(vvl_base_url "https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download") + file(DOWNLOAD "${vvl_base_url}/vulkan-sdk-${vvl_version}/android-binaries-${vvl_version}.zip" + "${vvl_zip_file}" SHOW_PROGRESS) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${vvl_zip_file}" + WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals") + endif() - # Copy the arm64 binary to src/android/app/main/jniLibs - set(vvl_lib_path "${CMAKE_CURRENT_SOURCE_DIR}/src/android/app/src/main/jniLibs/arm64-v8a/") - file(COPY "${CMAKE_BINARY_DIR}/externals/android-binaries-${vvl_version}/arm64-v8a/libVkLayer_khronos_validation.so" - DESTINATION "${vvl_lib_path}") + # Copy the arm64 binary to src/android/app/main/jniLibs + file(COPY "${CMAKE_BINARY_DIR}/externals/android-binaries-${vvl_version}/arm64-v8a/libVkLayer_khronos_validation.so" + DESTINATION "${vvl_lib_path}") + endif() endif() if (ANDROID) |