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.
This commit is contained in:
parent
e7e5906892
commit
f78b30dbc4
1 changed files with 16 additions and 11 deletions
|
|
@ -91,20 +91,25 @@ option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENAB
|
||||||
if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL)
|
if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL)
|
||||||
set(vvl_version "sdk-1.3.261.1")
|
set(vvl_version "sdk-1.3.261.1")
|
||||||
set(vvl_zip_file "${CMAKE_BINARY_DIR}/externals/vvl-android.zip")
|
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
|
# Download and extract validation layer release to externals directory
|
||||||
|
if (NOT EXISTS "${vvl_zip_file}")
|
||||||
set(vvl_base_url "https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download")
|
set(vvl_base_url "https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download")
|
||||||
file(DOWNLOAD "${vvl_base_url}/${vvl_version}/android-binaries-${vvl_version}-android.zip"
|
file(DOWNLOAD "${vvl_base_url}/vulkan-sdk-${vvl_version}/android-binaries-${vvl_version}.zip"
|
||||||
"${vvl_zip_file}" SHOW_PROGRESS)
|
"${vvl_zip_file}" SHOW_PROGRESS)
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${vvl_zip_file}"
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${vvl_zip_file}"
|
||||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals")
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Copy the arm64 binary to src/android/app/main/jniLibs
|
# 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"
|
file(COPY "${CMAKE_BINARY_DIR}/externals/android-binaries-${vvl_version}/arm64-v8a/libVkLayer_khronos_validation.so"
|
||||||
DESTINATION "${vvl_lib_path}")
|
DESTINATION "${vvl_lib_path}")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
set(CMAKE_SKIP_INSTALL_RULES ON)
|
set(CMAKE_SKIP_INSTALL_RULES ON)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue