diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b57a37..fc50b48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: platform: android artifact-name: godot-cpp-android-arm64-release artifact-path: bin/libgodot-cpp.android.release.arm64.a - flags: arch=arm64 + flags: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME arch=arm64 - name: 🍏 iOS (arm64) os: macos-11 diff --git a/tools/android.py b/tools/android.py index 98c3b3f..e96f9e6 100644 --- a/tools/android.py +++ b/tools/android.py @@ -18,19 +18,15 @@ def options(opts): def exists(env): - if not "ANDROID_NDK_ROOT" in os.environ: - return False - return True + return "ANDROID_NDK_ROOT" in os.environ or "ANDROID_NDK_ROOT" in ARGUMENTS def generate(env): - if not "ANDROID_NDK_ROOT" in os.environ: + if "ANDROID_NDK_ROOT" not in env: raise ValueError( "To build for Android, ANDROID_NDK_ROOT must be defined. Please set ANDROID_NDK_ROOT to the root folder of your Android NDK installation." ) - env["ANDROID_NDK_ROOT"] = os.environ["ANDROID_NDK_ROOT"] - if env["arch"] not in ("arm64", "x86_64", "arm32", "x86_32"): print("Only arm64, x86_64, arm32, and x86_32 are supported on Android. Exiting.") Exit()