Selaa lähdekoodia

Make ndk version configurable as a command-like argument.

(cherry picked from commit 16e47d7ae5bc45af90caeab16beecfe9ec4802c5)
Lukas Tenbrink 4 kuukautta sitten
vanhempi
commit
0be68c870f
1 muutettua tiedostoa jossa 7 lisäystä ja 7 poistoa
  1. 7 7
      tools/android.py

+ 7 - 7
tools/android.py

@@ -11,6 +11,11 @@ def options(opts):
         "Target Android API level",
         "21",
     )
+    opts.Add(
+        "ndk_version",
+        "Fully qualified version of ndk to use for compilation.",
+        "23.2.8568313",
+    )
     opts.Add(
         "ANDROID_HOME",
         "Path to your Android SDK installation. By default, uses ANDROID_HOME from your defined environment variables.",
@@ -22,14 +27,9 @@ def exists(env):
     return get_android_ndk_root(env) is not None
 
 
-# This must be kept in sync with the value in https://github.com/godotengine/godot/blob/master/platform/android/detect.py#L58.
-def get_ndk_version():
-    return "23.2.8568313"
-
-
 def get_android_ndk_root(env):
     if env["ANDROID_HOME"]:
-        return env["ANDROID_HOME"] + "/ndk/" + get_ndk_version()
+        return env["ANDROID_HOME"] + "/ndk/" + env["ndk_version"]
     else:
         return os.environ.get("ANDROID_NDK_ROOT")
 
@@ -68,7 +68,7 @@ def generate(env):
 
     if not os.path.exists(toolchain):
         print("ERROR: Could not find NDK toolchain at " + toolchain + ".")
-        print("Make sure NDK version " + get_ndk_version() + " is installed.")
+        print("Make sure NDK version " + env["ndk_version"] + " is installed.")
         env.Exit(1)
 
     env.PrependENVPath("PATH", toolchain + "/bin")  # This does nothing half of the time, but we'll put it here anyways