summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2024-03-25 23:41:45 +0800
committerruki <[email protected]>2024-03-25 23:41:45 +0800
commit68bd8f141a587b77163c2bf0615400bfc043ec0e (patch)
treeb7e88cf98b7981876ff25bf7132078c4f4e83106 /xmake/modules
parent820d2df5f51d94daf3e44db168dfcd048c467917 (diff)
fix check color flags
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/core/tools/gcc.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index ff1431934..e3fa97a27 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -575,10 +575,12 @@ function _has_color_diagnostics(self)
-- for clang
elseif self:has_flags("-fcolor-diagnostics", "cxflags") then
colors_diagnostics = "-fcolor-diagnostics"
- -- enable color output for windows, @see https://github.com/xmake-io/xmake-vscode/discussions/260
- if is_host("windows") and self:has_flags("-fansi-escape-codes", "cxflags") then
- colors_diagnostics = table.join(colors_diagnostics, "-fansi-escape-codes")
- end
+ end
+
+ -- enable color output for windows, @see https://github.com/xmake-io/xmake-vscode/discussions/260
+ if colors_diagnostics and self:name() == "clang" and is_host("windows") and
+ self:has_flags("-fansi-escape-codes", "cxflags") then
+ colors_diagnostics = table.join(colors_diagnostics, "-fansi-escape-codes")
end
end
end