diff --git a/docs/build/Android.md b/docs/build/Android.md index c8ff3a3b1e..f511f71370 100644 --- a/docs/build/Android.md +++ b/docs/build/Android.md @@ -33,6 +33,7 @@ Eden by default will be cloned into - 4. Navigate to `eden/src/android`. 5. Then Build with `./gradlew assembleRelWithDebInfo`. 6. To build the optimised build use `./gradlew assembleGenshinSpoofRelWithDebInfo`. +7. You can pass extra variables to cmake via `-PYUZU_ANDROID_ARGS="-D..."` ### Script A convenience script for building is provided in `.ci/android/build.sh`. The built APK can be put into an `artifacts` directory via `.ci/android/package.sh`. On Windows, these must be done in the Git Bash or MinGW terminal. diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index e8d8141711..c2ed8fdbf4 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -72,6 +72,30 @@ android { buildConfigField("String", "GIT_HASH", "\"${getGitHash()}\"") buildConfigField("String", "BRANCH", "\"${getBranch()}\"") + + externalNativeBuild { + cmake { + val extraCMakeArgs = (project.findProperty("YUZU_ANDROID_ARGS") as String?)?.split("\\s+".toRegex()) ?: emptyList() + + arguments( + "-DENABLE_QT=0", // Don't use QT + "-DENABLE_SDL2=0", // Don't use SDL + "-DENABLE_WEB_SERVICE=1", // Enable web service + "-DENABLE_OPENSSL=ON", + "-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work + "-DYUZU_USE_CPM=ON", + "-DCPMUTIL_FORCE_BUNDLED=ON", + "-DYUZU_USE_BUNDLED_FFMPEG=ON", + "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", + "-DBUILD_TESTING=OFF", + "-DYUZU_TESTS=OFF", + "-DDYNARMIC_TESTS=OFF", + *extraCMakeArgs.toTypedArray() + ) + + abiFilters("arm64-v8a") + } + } } val keystoreFile = System.getenv("ANDROID_KEYSTORE_FILE") @@ -162,29 +186,6 @@ android { path = file("../../../CMakeLists.txt") } } - - defaultConfig { - externalNativeBuild { - cmake { - arguments( - "-DENABLE_QT=0", // Don't use QT - "-DENABLE_SDL2=0", // Don't use SDL - "-DENABLE_WEB_SERVICE=1", // Enable web service - "-DENABLE_OPENSSL=ON", - "-DANDROID_ARM_NEON=true", // cryptopp requires Neon to work - "-DYUZU_USE_CPM=ON", - "-DCPMUTIL_FORCE_BUNDLED=ON", - "-DYUZU_USE_BUNDLED_FFMPEG=ON", - "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", - "-DBUILD_TESTING=OFF", - "-DYUZU_TESTS=OFF", - "-DDYNARMIC_TESTS=OFF" - ) - - abiFilters("arm64-v8a") - } - } - } } tasks.register("ktlintReset", fun Delete.() { diff --git a/src/dynarmic/CMakeLists.txt b/src/dynarmic/CMakeLists.txt index 6b3308fb54..921839b7f1 100644 --- a/src/dynarmic/CMakeLists.txt +++ b/src/dynarmic/CMakeLists.txt @@ -25,11 +25,7 @@ option(DYNARMIC_IGNORE_ASSERTS "Ignore asserts" OFF) option(DYNARMIC_TESTS_USE_UNICORN "Enable fuzzing tests against unicorn" OFF) CMAKE_DEPENDENT_OPTION(DYNARMIC_USE_LLVM "Support disassembly of jitted x86_64 code using LLVM" OFF "NOT YUZU_DISABLE_LLVM" OFF) -if (PLATFORM_OPENBSD) - option(DYNARMIC_USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF) -else() - option(DYNARMIC_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON) -endif() +option(DYNARMIC_USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF) option(DYNARMIC_INSTALL "Install dynarmic headers and CMake files" OFF) option(DYNARMIC_USE_BUNDLED_EXTERNALS "Use all bundled externals (useful when e.g. cross-compiling)" OFF)