From 820d2df5f51d94daf3e44db168dfcd048c467917 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 25 Mar 2024 23:40:45 +0800 Subject: improve color output for clang on windows --- xmake/modules/core/tools/gcc.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xmake/modules/core/tools/gcc.lua') diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 216898f97..ff1431934 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -575,6 +575,10 @@ 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 end end -- cgit v1.3.1