diff options
| author | ruki <[email protected]> | 2021-09-26 11:24:49 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-09-26 11:24:49 +0800 |
| commit | be70f45c99e92a8f72c52bca943601761e18215d (patch) | |
| tree | d115872c6d73ea9601c574ed43740a0ad0a56a5f /xmake/modules/detect | |
| parent | 32f89fbfcfb6367f09813750c8c791647e24b63d (diff) | |
improve android ndk support for r23
Diffstat (limited to 'xmake/modules/detect')
| -rw-r--r-- | xmake/modules/detect/sdks/find_ndk.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/xmake/modules/detect/sdks/find_ndk.lua b/xmake/modules/detect/sdks/find_ndk.lua index bc07f6081..4e355e49b 100644 --- a/xmake/modules/detect/sdks/find_ndk.lua +++ b/xmake/modules/detect/sdks/find_ndk.lua @@ -188,8 +188,12 @@ function _find_ndk(sdkdir, arch, ndk_sdkver, ndk_toolchains_ver) local gcc_toolchain_subdir = gcc_toolchain_subdirs[arch] or "arm-linux-androideabi-*" -- find the binary directory - local bindir = find_directory("bin", path.join(sdkdir, "toolchains", "llvm", "prebuilt", "*")) -- larger than ndk r16 - if not bindir then + local llvm_toolchain + local prebuilt = (is_host("macosx") and "darwin" or os.host()) .. "-x86_64" + local bindir = find_directory("bin", path.join(sdkdir, "toolchains", "llvm", "prebuilt", prebuilt)) -- larger than ndk r16 + if bindir then + llvm_toolchain = path.directory(bindir) + else bindir = find_directory("bin", path.join(sdkdir, "toolchains", gcc_toolchain_subdir, "prebuilt", "*")) end if not bindir then @@ -231,6 +235,7 @@ function _find_ndk(sdkdir, arch, ndk_sdkver, ndk_toolchains_ver) bindir = bindir, cross = cross, sdkver = sdkver, + llvm_toolchain = llvm_toolchain, -- >= ndk r22 gcc_toolchain = gcc_toolchain, toolchains_ver = toolchains_ver, sysroot = sysroot} @@ -280,7 +285,6 @@ function main(sdkdir, opt) if opt.verbose or option.get("verbose") then cprint("checking for NDK directory ... ${color.success}%s", ndk.sdkdir) cprint("checking for SDK version of NDK ... ${color.success}%s", ndk.sdkver) - cprint("checking for toolchains version of NDK ... ${color.success}%s", ndk.toolchains_ver) end else |
