diff options
| author | ruki <[email protected]> | 2021-03-18 23:46:20 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-03-18 23:46:20 +0800 |
| commit | 7852d9f59e26ea7a357a4c9434bbfbb32729094a (patch) | |
| tree | a2c8cb0dabcf2cb601f4bb0f942804e245c65530 | |
| parent | 926e80670c1ac3048dcffe207ed4d32571b10363 (diff) | |
improve to check ndk
| -rw-r--r-- | xmake/toolchains/ndk/check.lua | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/xmake/toolchains/ndk/check.lua b/xmake/toolchains/ndk/check.lua index 9f54cdb9a..d7ecb4113 100644 --- a/xmake/toolchains/ndk/check.lua +++ b/xmake/toolchains/ndk/check.lua @@ -25,19 +25,19 @@ import("detect.sdks.find_android_sdk") -- check the ndk toolchain function _check_ndk(toolchain) - local ndk = find_ndk(toolchain:config("ndk") or config.get("ndk"), {force = true, verbose = true, sdkver = toolchain:config("sdkver")}) - if not ndk then - -- find it from packages - for _, package in ipairs(toolchain:packages()) do - local installdir = package:installdir() - if installdir and os.isdir(installdir) then - ndk = find_ndk(installdir, {force = true, verbose = true, sdkver = toolchain:config("sdkver")}) - if ndk then - break - end + local ndk + for _, package in ipairs(toolchain:packages()) do + local installdir = package:installdir() + if installdir and os.isdir(installdir) then + ndk = find_ndk(installdir, {force = true, verbose = true, sdkver = toolchain:config("sdkver")}) + if ndk then + break end end end + if not ndk then + ndk = find_ndk(toolchain:config("ndk") or config.get("ndk"), {force = true, verbose = true, sdkver = toolchain:config("sdkver")}) + end if ndk then toolchain:config_set("ndk", ndk.sdkdir) toolchain:config_set("bindir", ndk.bindir) |
