diff options
| author | ruki <[email protected]> | 2021-09-26 11:32:26 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-09-26 11:32:26 +0800 |
| commit | d18679202f372ac5528543827b8409fefd401cfd (patch) | |
| tree | abc497e13ecdaffc8759493e0cd1dd779e31c16f | |
| parent | be70f45c99e92a8f72c52bca943601761e18215d (diff) | |
improve to find ndk
| -rw-r--r-- | xmake/modules/detect/sdks/find_ndk.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/modules/detect/sdks/find_ndk.lua b/xmake/modules/detect/sdks/find_ndk.lua index 4e355e49b..ac412bce0 100644 --- a/xmake/modules/detect/sdks/find_ndk.lua +++ b/xmake/modules/detect/sdks/find_ndk.lua @@ -50,10 +50,16 @@ function _find_ndkdir(sdkdir) 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") + local ndkbundle = path.join(config.get("android_sdk"), "ndk-bundle") + if os.isdir(ndkbundle) then + sdkdir = ndkbundle + end end if not sdkdir and is_host("macosx") then - sdkdir = "~/Library/Android/sdk/ndk-bundle" + sdkdir = find_directory("NDK", "/Applications/AndroidNDK*.app/Contents") + if not sdkdir then + sdkdir = "~/Library/Android/sdk/ndk-bundle" + end end end |
