summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/clang.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/clang.lua')
-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