Skip to content

Make ndk version configurable as a command-like argument. #1779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tools/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand All @@ -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")

Expand Down Expand Up @@ -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
Expand Down
Loading