Skip to content

Commit fef59ff

Browse files
authored
Merge pull request #1779 from Ivorforce/ndk-version
Make ndk version configurable as a command-like argument.
2 parents a7127d3 + 16e47d7 commit fef59ff

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tools/android.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ def options(opts):
1111
"Target Android API level",
1212
"21",
1313
)
14+
opts.Add(
15+
"ndk_version",
16+
"Fully qualified version of ndk to use for compilation.",
17+
"23.2.8568313",
18+
)
1419
opts.Add(
1520
"ANDROID_HOME",
1621
"Path to your Android SDK installation. By default, uses ANDROID_HOME from your defined environment variables.",
@@ -22,14 +27,9 @@ def exists(env):
2227
return get_android_ndk_root(env) is not None
2328

2429

25-
# This must be kept in sync with the value in https://github.com/godotengine/godot/blob/master/platform/android/detect.py#L58.
26-
def get_ndk_version():
27-
return "23.2.8568313"
28-
29-
3030
def get_android_ndk_root(env):
3131
if env["ANDROID_HOME"]:
32-
return env["ANDROID_HOME"] + "/ndk/" + get_ndk_version()
32+
return env["ANDROID_HOME"] + "/ndk/" + env["ndk_version"]
3333
else:
3434
return os.environ.get("ANDROID_NDK_ROOT")
3535

@@ -68,7 +68,7 @@ def generate(env):
6868

6969
if not os.path.exists(toolchain):
7070
print("ERROR: Could not find NDK toolchain at " + toolchain + ".")
71-
print("Make sure NDK version " + get_ndk_version() + " is installed.")
71+
print("Make sure NDK version " + env["ndk_version"] + " is installed.")
7272
env.Exit(1)
7373

7474
env.PrependENVPath("PATH", toolchain + "/bin") # This does nothing half of the time, but we'll put it here anyways

0 commit comments

Comments
 (0)