diff options
| author | ruki <[email protected]> | 2020-04-18 19:35:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-04-18 19:35:51 +0800 |
| commit | 0ef9076bdb3423f69a05d51389078cafe475d741 (patch) | |
| tree | f1835e3ff1a0a991e984e4bf025be625ee27b5b4 | |
| parent | edf228fe9a4f1dd748e564562475b73078c42f89 (diff) | |
improve find_ndk
| -rw-r--r-- | xmake/modules/detect/sdks/find_ndk.lua | 3 | ||||
| -rw-r--r-- | xmake/platforms/android/config.lua | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/xmake/modules/detect/sdks/find_ndk.lua b/xmake/modules/detect/sdks/find_ndk.lua index df7616fc2..7dee10690 100644 --- a/xmake/modules/detect/sdks/find_ndk.lua +++ b/xmake/modules/detect/sdks/find_ndk.lua @@ -31,6 +31,9 @@ function _find_ndkdir(sdkdir) -- get ndk directory if not sdkdir then sdkdir = os.getenv("ANDROID_NDK_HOME") or os.getenv("ANDROID_NDK_ROOT") + if not sdkdir and config.get("android_sdk") then + sdkdir = path.join(config.get("android_sdk"), "ndk-bundle") + end if not sdkdir and is_host("macosx") then sdkdir = "~/Library/Android/sdk/ndk-bundle" end diff --git a/xmake/platforms/android/config.lua b/xmake/platforms/android/config.lua index 056a768e6..f199d08ba 100644 --- a/xmake/platforms/android/config.lua +++ b/xmake/platforms/android/config.lua @@ -140,12 +140,12 @@ function main(platform, name) -- check arch check_arch(config, "armeabi-v7a") - -- check ndk - _check_ndk() - -- check android sdk _check_android_sdk() + -- check ndk + _check_ndk() + -- check ld and sh, @note toolchains must be initialized after calling check_ndk() local toolchains = singleton.get("android.toolchains", _toolchains) check_toolchain(config, "ld", toolchains.ld) |
