summaryrefslogtreecommitdiff
path: root/xmake/modules/private/utils/target.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-26 00:49:52 +0800
committerruki <[email protected]>2025-09-26 00:49:52 +0800
commit4321dfa63bb08dc761ab6810e758a8274cc46162 (patch)
tree48390822fb1bb314fe325c743c2f0fea09722d5c /xmake/modules/private/utils/target.lua
parent177fc33ef050f5a9c443c3b07b04ba23c4be5e90 (diff)
improve to check cxxflags
Diffstat (limited to 'xmake/modules/private/utils/target.lua')
-rw-r--r--xmake/modules/private/utils/target.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/xmake/modules/private/utils/target.lua b/xmake/modules/private/utils/target.lua
index ec64e05b1..84c307788 100644
--- a/xmake/modules/private/utils/target.lua
+++ b/xmake/modules/private/utils/target.lua
@@ -37,7 +37,14 @@ function flag_belong_to_tool(flag, toolinst, extraconf)
for_this_tool = false
local splitinfo = flag:split("::", {plain = true})
local toolname = splitinfo[1]
- if toolname == toolinst:name() then
+ local realname = toolinst:name()
+ -- We need compatibility with gcc/g++, clang/clang++ for c++ compiler/linker
+ -- @see https://github.com/xmake-io/xmake/issues/6852
+ if realname == "clangxx" or realname == "gxx" then
+ toolname = toolname:rtrim("xx")
+ realname = realname:rtrim("xx")
+ end
+ if toolname == realname then
flag = splitinfo[2]
for_this_tool = true
end