diff options
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/clang.lua | 5 | ||||
| -rw-r--r-- | xmake/toolchains/clang/xmake.lua | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua index eeb0cdf8a..70808ea56 100644 --- a/xmake/rules/c++/modules/modules_support/clang.lua +++ b/xmake/rules/c++/modules/modules_support/clang.lua @@ -41,13 +41,14 @@ function _get_bmi_path(bmifile) return bmifile end --- get clang path +-- get clang path, we need get it's absolute path +-- @see https://github.com/xmake-io/xmake/issues/4575#issuecomment-1879596450 function _get_clang_path(target) local clang_path = _g.clang_path if not clang_path then local program, toolname = target:tool("cxx") if program and (toolname == "clang" or toolname == "clangxx") then - local clang = find_tool("clang", {program = program}) + local clang = find_tool("clang", {program = program, envs = os.getenvs()}) if clang then clang_path = clang.program end diff --git a/xmake/toolchains/clang/xmake.lua b/xmake/toolchains/clang/xmake.lua index c6789c890..0f9662cee 100644 --- a/xmake/toolchains/clang/xmake.lua +++ b/xmake/toolchains/clang/xmake.lua @@ -35,8 +35,8 @@ toolchain("clang" .. suffix) set_toolset("cxx", "clang" .. suffix, "clang++" .. suffix) set_toolset("ld", "clang++" .. suffix, "clang" .. suffix) set_toolset("sh", "clang++" .. suffix, "clang" .. suffix) - set_toolset("ar", "ar") - set_toolset("strip", "strip") + set_toolset("ar", "ar", "llvm-ar") + set_toolset("strip", "strip", "llvm-strip") set_toolset("mm", "clang" .. suffix) set_toolset("mxx", "clang" .. suffix, "clang++" .. suffix) set_toolset("as", "clang" .. suffix) |
