summaryrefslogtreecommitdiff
path: root/xmake/toolchains
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-11-04 12:42:45 +0100
committerruki <[email protected]>2025-12-18 09:31:43 +0800
commit5dcd669f6e3017d6939af6fd391803c13395406a (patch)
treeb556d829a3e874be558ac16a29708bc321acfd6f /xmake/toolchains
parent7a1be435eef977b88a2855df9bafc4ebeca1843e (diff)
fix(llvm) fix nf_runtime clang
Diffstat (limited to 'xmake/toolchains')
-rw-r--r--xmake/toolchains/llvm/check.lua6
-rw-r--r--xmake/toolchains/llvm/xmake.lua12
2 files changed, 10 insertions, 8 deletions
diff --git a/xmake/toolchains/llvm/check.lua b/xmake/toolchains/llvm/check.lua
index 54901824a..74cc96a7f 100644
--- a/xmake/toolchains/llvm/check.lua
+++ b/xmake/toolchains/llvm/check.lua
@@ -115,11 +115,13 @@ function main(toolchain)
toolchain:config_set("bindir", cross_toolchain.bindir)
toolchain:config_set("sdkdir", cross_toolchain.sdkdir)
else
- raise("llvm toolchain not found!")
+ wprint("llvm toolchain not found!")
+ return false
end
if toolchain:is_plat("cross") and (not toolchain:cross() or toolchain:cross():match("^%s*$")) then
- raise("Missing cross target. Use `--cross=name` to specify.")
+ wprint("Missing cross target. Use `--cross=name` to specify.")
+ return false
end
-- attempt to find xcode to pass `-isysroot` on macos
diff --git a/xmake/toolchains/llvm/xmake.lua b/xmake/toolchains/llvm/xmake.lua
index d4557071c..61288f1bd 100644
--- a/xmake/toolchains/llvm/xmake.lua
+++ b/xmake/toolchains/llvm/xmake.lua
@@ -50,12 +50,18 @@ toolchain("llvm")
on_check("check")
on_load(function (toolchain)
+ import("private.utils.toolchain", {alias = "toolchain_utils"})
-- add runtimes
if toolchain:is_plat("windows") then
toolchain:add("runtimes", "MT", "MTd", "MD", "MDd")
end
+ local dirs = toolchain_utils.get_llvm_dirs(toolchain)
+ if dirs and dirs.rt then
+ toolchain:add("runenvs", dirs.rt)
+ end
+
-- add target flags
local target
if toolchain:is_plat("windows") and not is_host("windows") then
@@ -151,11 +157,5 @@ toolchain("llvm")
toolchain:add("shflags", "--sysroot=" .. sysroot)
end
end
-
- -- add bin search library for loading some dependent .dll files windows
- local bindir = toolchain:bindir()
- if bindir and is_host("windows") then
- toolchain:add("runenvs", "PATH", bindir)
- end
end)