summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support
diff options
context:
space:
mode:
authorruki <[email protected]>2024-01-06 23:28:44 +0800
committerruki <[email protected]>2024-01-06 23:28:44 +0800
commit30276f1602c0d6b1a6281df76fc7b437b2013528 (patch)
tree4e935c64ddaedf90520d797543ea090931ae4869 /xmake/rules/c++/modules/modules_support
parented7bd9321a7910bfa75848cfa5f7d140b3a68e46 (diff)
improve to get clang path
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
-rw-r--r--xmake/rules/c++/modules/modules_support/clang.lua5
1 files changed, 3 insertions, 2 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