android: support extra cmake args via -PYUZU_ANDROID_ARGS
All checks were successful
eden-license / license-header (pull_request) Successful in 25s

* also move externalNativeBuild/cmake/argurments to main defaultConfig

Signed-off-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
This commit is contained in:
Caio Oliveira 2025-10-04 11:03:35 -03:00
parent 83730cd4c1
commit 0ab49c26d5
Signed by: DraVee
GPG key ID: 362DA3DC1901E080
2 changed files with 25 additions and 23 deletions

View file

@ -33,6 +33,7 @@ Eden by default will be cloned into -
4. Navigate to `eden/src/android`. 4. Navigate to `eden/src/android`.
5. Then Build with `./gradlew assembleRelWithDebInfo`. 5. Then Build with `./gradlew assembleRelWithDebInfo`.
6. To build the optimised build use `./gradlew assembleGenshinSpoofRelWithDebInfo`. 6. To build the optimised build use `./gradlew assembleGenshinSpoofRelWithDebInfo`.
7. You can pass extra variables to cmake via `-PYUZU_ANDROID_ARGS="-D..."`
### Script ### 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. 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.

View file

@ -72,6 +72,30 @@ android {
buildConfigField("String", "GIT_HASH", "\"${getGitHash()}\"") buildConfigField("String", "GIT_HASH", "\"${getGitHash()}\"")
buildConfigField("String", "BRANCH", "\"${getBranch()}\"") 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") val keystoreFile = System.getenv("ANDROID_KEYSTORE_FILE")
@ -162,29 +186,6 @@ android {
path = file("../../../CMakeLists.txt") 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<Delete>("ktlintReset", fun Delete.() { tasks.register<Delete>("ktlintReset", fun Delete.() {