diff options
| author | ruki <[email protected]> | 2024-01-07 00:10:50 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-01-07 00:10:50 +0800 |
| commit | 5fb5b232a75e8e2de143952b040c1a85a7ebeec5 (patch) | |
| tree | 1a23ce6c677fc09f962734f73b09746c4e7217ab | |
| parent | ed7bd9321a7910bfa75848cfa5f7d140b3a68e46 (diff) | |
| parent | a8f112733c84e88573dacd08fce97fda0f83b906 (diff) | |
Merge pull request #4576 from xmake-io/clang
improve to get clang path
| -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) |
