summaryrefslogtreecommitdiff
path: root/xmake/toolchains/llvm/check.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-09-25 22:44:35 +0800
committerruki <[email protected]>2023-09-25 22:44:35 +0800
commit822140a5e8cdc53cc03448a54da94628b6389749 (patch)
tree8bd081bc03ee71df262efe51b262bc512b0150eb /xmake/toolchains/llvm/check.lua
parentbff91f6b065fdf8c1c906cc195c57817864130f1 (diff)
improve to llvm toolchain
Diffstat (limited to 'xmake/toolchains/llvm/check.lua')
-rw-r--r--xmake/toolchains/llvm/check.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/toolchains/llvm/check.lua b/xmake/toolchains/llvm/check.lua
index 0f3943013..7c2a30cd9 100644
--- a/xmake/toolchains/llvm/check.lua
+++ b/xmake/toolchains/llvm/check.lua
@@ -58,7 +58,10 @@ function main(toolchain)
local sdkdir = toolchain:sdkdir()
local bindir = toolchain:bindir()
if not sdkdir and not bindir then
- if is_host("linux") and os.isfile("/usr/bin/llvm-ar") then
+ bindir = try {function () return os.iorunv("llvm-config", {"--bindir"}) end}
+ if bindir then
+ sdkdir = path.directory(bindir)
+ elseif is_host("linux") and os.isfile("/usr/bin/llvm-ar") then
sdkdir = "/usr"
elseif is_host("macosx") then
local bindir