diff options
| author | 2023-09-08 22:43:54 +0300 | |
|---|---|---|
| committer | 2023-09-08 23:13:52 +0300 | |
| commit | 254b2bd9dfb71e7754b6f923735afbf97b01f2da (patch) | |
| tree | e6c03648b0adfa0eed6dc7470366da7c61637485 | |
| parent | Merge pull request #11420 from t895/long-install-fix (diff) | |
| download | yuzu-254b2bd9dfb71e7754b6f923735afbf97b01f2da.tar.gz yuzu-254b2bd9dfb71e7754b6f923735afbf97b01f2da.tar.xz yuzu-254b2bd9dfb71e7754b6f923735afbf97b01f2da.zip | |
cmake: Add option to fetch validation layer binary on android
Diffstat (limited to '')
| -rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4039c680e..c6b158985 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -49,6 +49,8 @@ option(YUZU_TESTS "Compile tests" "${BUILD_TESTING}") | |||
| 49 | 49 | ||
| 50 | option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) | 50 | option(YUZU_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) |
| 51 | 51 | ||
| 52 | option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android" ON) | ||
| 53 | |||
| 52 | CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Compile LDN room server" ON "NOT ANDROID" OFF) | 54 | CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Compile LDN room server" ON "NOT ANDROID" OFF) |
| 53 | 55 | ||
| 54 | CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile Windows crash dump (Minidump) support" OFF "WIN32" OFF) | 56 | CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile Windows crash dump (Minidump) support" OFF "WIN32" OFF) |
| @@ -77,6 +79,24 @@ if (ANDROID OR WIN32 OR APPLE) | |||
| 77 | endif() | 79 | endif() |
| 78 | option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL}) | 80 | option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL}) |
| 79 | 81 | ||
| 82 | if (ANDROID AND YUZU_DOWNLOAD_ANDROID_VVL) | ||
| 83 | set(vvl_version "sdk-1.3.261.1") | ||
| 84 | set(vvl_zip_file "${CMAKE_BINARY_DIR}/externals/vvl-android.zip") | ||
| 85 | if (NOT EXISTS "${vvl_zip_file}") | ||
| 86 | # Download and extract validation layer release to externals directory | ||
| 87 | set(vvl_base_url "https://github.com/KhronosGroup/Vulkan-ValidationLayers/releases/download") | ||
| 88 | file(DOWNLOAD "${vvl_base_url}/${vvl_version}/android-binaries-${vvl_version}-android.zip" | ||
| 89 | "${vvl_zip_file}" SHOW_PROGRESS) | ||
| 90 | execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${vvl_zip_file}" | ||
| 91 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals") | ||
| 92 | endif() | ||
| 93 | |||
| 94 | # Copy the arm64 binary to src/android/app/main/jniLibs | ||
| 95 | set(vvl_lib_path "${CMAKE_CURRENT_SOURCE_DIR}/src/android/app/src/main/jniLibs/arm64-v8a/") | ||
| 96 | file(COPY "${CMAKE_BINARY_DIR}/externals/android-binaries-${vvl_version}/arm64-v8a/libVkLayer_khronos_validation.so" | ||
| 97 | DESTINATION "${vvl_lib_path}") | ||
| 98 | endif() | ||
| 99 | |||
| 80 | # On Android, fetch and compile libcxx before doing anything else | 100 | # On Android, fetch and compile libcxx before doing anything else |
| 81 | if (ANDROID) | 101 | if (ANDROID) |
| 82 | set(CMAKE_SKIP_INSTALL_RULES ON) | 102 | set(CMAKE_SKIP_INSTALL_RULES ON) |