summaryrefslogtreecommitdiff
path: root/xmake/toolchains/llvm/check.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-02-16 23:43:57 +0800
committerruki <[email protected]>2021-02-16 23:43:57 +0800
commit5ec37d1979611aad83348afc8fc8c3adabbbc5b7 (patch)
tree29de062fe30b7888ac9d69c375854f579d45515b /xmake/toolchains/llvm/check.lua
parent7209d292659792a6d92071959537c09a2bd48c4c (diff)
improve cross/bindir/sdkdir for toolchains
Diffstat (limited to 'xmake/toolchains/llvm/check.lua')
-rw-r--r--xmake/toolchains/llvm/check.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/xmake/toolchains/llvm/check.lua b/xmake/toolchains/llvm/check.lua
index 44ea1ae2d..690a6ea30 100644
--- a/xmake/toolchains/llvm/check.lua
+++ b/xmake/toolchains/llvm/check.lua
@@ -28,7 +28,7 @@ function _find_xcode(toolchain)
-- find xcode
local xcode_sdkver = toolchain:config("xcode_sdkver") or config.get("xcode_sdkver")
- local xcode = find_xcode(config.get("xcode"), {force = true, verbose = true,
+ local xcode = find_xcode(toolchain:config("xcode") or config.get("xcode"), {force = true, verbose = true,
find_codesign = false,
sdkver = xcode_sdkver,
plat = toolchain:plat(),
@@ -54,8 +54,8 @@ end
function main(toolchain)
-- get sdk directory
- local sdkdir = config.get("sdk")
- local bindir = config.get("bin")
+ 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
sdkdir = "/usr"
@@ -77,8 +77,9 @@ function main(toolchain)
end
end
if cross_toolchain then
- config.set("cross", cross_toolchain.cross, {readonly = true, force = true})
- config.set("bin", cross_toolchain.bindir, {readonly = true, force = true})
+ toolchain:config_set("cross", cross_toolchain.cross)
+ toolchain:config_set("bindir", cross_toolchain.bindir)
+ toolchain:configs_save()
else
raise("llvm toolchain not found!")
end