summaryrefslogtreecommitdiff
path: root/xmake/toolchains/ndk/check.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-03-18 22:54:20 +0800
committerruki <[email protected]>2021-03-18 22:54:20 +0800
commit5f4104bb7c5b188965f30d401762162294764b73 (patch)
treefe1886f80091e2f5772d54fe76612343113b4a34 /xmake/toolchains/ndk/check.lua
parent60932027d85e9cb499132351b5f080f8d2f572a8 (diff)
support ndk package
Diffstat (limited to 'xmake/toolchains/ndk/check.lua')
-rw-r--r--xmake/toolchains/ndk/check.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/xmake/toolchains/ndk/check.lua b/xmake/toolchains/ndk/check.lua
index fe8183277..583e6d591 100644
--- a/xmake/toolchains/ndk/check.lua
+++ b/xmake/toolchains/ndk/check.lua
@@ -26,6 +26,18 @@ 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})
+ 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})
+ if ndk then
+ break
+ end
+ end
+ end
+ end
if ndk then
toolchain:config_set("ndk", ndk.sdkdir)
toolchain:config_set("bindir", ndk.bindir)