diff options
| -rw-r--r-- | xmake/toolchains/llvm/check.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/toolchains/llvm/check.lua b/xmake/toolchains/llvm/check.lua index 690a6ea30..f63418cc8 100644 --- a/xmake/toolchains/llvm/check.lua +++ b/xmake/toolchains/llvm/check.lua @@ -20,6 +20,7 @@ -- imports import("core.project.config") +import("lib.detect.find_path") import("detect.sdks.find_xcode") import("detect.sdks.find_cross_toolchain") @@ -57,8 +58,13 @@ function main(toolchain) local sdkdir = toolchain:sdkdir() local bindir = toolchain:bindir() if not sdkdir and not bindir then - if toolchain:is_plat("linux") and os.isfile("/usr/bin/llvm-ar") then + if is_host("linux") and os.isfile("/usr/bin/llvm-ar") then sdkdir = "/usr" + elseif is_host("macosx") then + local bindir = find_path("llvm-ar", "/usr/local/Cellar/llvm/*/bin") + if bindir then + sdkdir = path.directory(bindir) + end end end |
