mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-03 18:09:13 +03:00
Make ndk version configurable as a command-like argument.
(cherry picked from commit 16e47d7ae5)
This commit is contained in:
committed by
David Snopek
parent
6cdac999c2
commit
7b4ca64761
@@ -11,6 +11,11 @@ def options(opts):
|
|||||||
"Target Android API level",
|
"Target Android API level",
|
||||||
"21",
|
"21",
|
||||||
)
|
)
|
||||||
|
opts.Add(
|
||||||
|
"ndk_version",
|
||||||
|
"Fully qualified version of ndk to use for compilation.",
|
||||||
|
"23.2.8568313",
|
||||||
|
)
|
||||||
opts.Add(
|
opts.Add(
|
||||||
"ANDROID_HOME",
|
"ANDROID_HOME",
|
||||||
"Path to your Android SDK installation. By default, uses ANDROID_HOME from your defined environment variables.",
|
"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
|
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):
|
def get_android_ndk_root(env):
|
||||||
if env["ANDROID_HOME"]:
|
if env["ANDROID_HOME"]:
|
||||||
return env["ANDROID_HOME"] + "/ndk/" + get_ndk_version()
|
return env["ANDROID_HOME"] + "/ndk/" + env["ndk_version"]
|
||||||
else:
|
else:
|
||||||
return os.environ.get("ANDROID_NDK_ROOT")
|
return os.environ.get("ANDROID_NDK_ROOT")
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ def generate(env):
|
|||||||
|
|
||||||
if not os.path.exists(toolchain):
|
if not os.path.exists(toolchain):
|
||||||
print("ERROR: Could not find NDK toolchain at " + 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.Exit(1)
|
||||||
|
|
||||||
env.PrependENVPath("PATH", toolchain + "/bin") # This does nothing half of the time, but we'll put it here anyways
|
env.PrependENVPath("PATH", toolchain + "/bin") # This does nothing half of the time, but we'll put it here anyways
|
||||||
|
|||||||
Reference in New Issue
Block a user