diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-18 11:03:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-18 11:03:16 +0100 |
commit | 65a75dc5f4d8be091c0aed47ca879dcb11fb5c27 (patch) | |
tree | a3fbc4fd9dd693e7f8238d941af3c23ead814a0c /platform/android | |
parent | 9d84e3b395631f1ffc27813c0d25bc41f655fb08 (diff) | |
parent | edeca16fb66e4e8521a255c824a4247eb982592c (diff) |
Merge pull request #46150 from m4gr3d/update_ndk_fetcher_logic
Override `ANDROID_NDK_ROOT` based on the project ndk version.
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/detect.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py index 98d4a21e26..5f0fcc9b77 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -13,7 +13,7 @@ def get_name(): def can_build(): - return ("ANDROID_NDK_ROOT" in os.environ) or ("ANDROID_SDK_ROOT" in os.environ) or ("ANDROID_HOME" in os.environ) + return ("ANDROID_SDK_ROOT" in os.environ) or ("ANDROID_HOME" in os.environ) def get_platform(platform): @@ -43,15 +43,12 @@ def get_android_sdk_root(): # Return the ANDROID_NDK_ROOT environment variable. -# If the env variable is already defined, we use it with the expectation that -# the user knows what they're doing (e.g: testing a new NDK version). -# Otherwise, we generate one for this build using the ANDROID_SDK_ROOT env +# We generate one for this build using the ANDROID_SDK_ROOT env # variable and the project ndk version. +# If the env variable is already defined, we override it with +# our own to match what the project expects. def get_android_ndk_root(): - if "ANDROID_NDK_ROOT" in os.environ: - return os.environ.get("ANDROID_NDK_ROOT", 0) - else: - return get_android_sdk_root() + "/ndk/" + get_project_ndk_version() + return get_android_sdk_root() + "/ndk/" + get_project_ndk_version() def get_flags(): |