summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/detect/sdks/find_ndk.lua3
-rw-r--r--xmake/platforms/android/config.lua6
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)