summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-01-18 11:27:26 +0800
committerGitHub <[email protected]>2021-01-18 11:27:26 +0800
commit7f237e38f2c6e5c751ca563003574145b15c7491 (patch)
treef850af000140f3e6aeecfcb29915092f0b967b58
parent2990775d7c2e2521c88d8a874c25cf13fc83c72a (diff)
parent892c52158eaf4259bf7b63e0a84eeffdbe930571 (diff)
Merge pull request #1201 from jonathanpoelen/fcolor
checks -fdiagnostics-color=always before -fcolor-diagnostics (support…
-rw-r--r--xmake/modules/core/tools/gcc.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index ef3fb4ce9..02b4b9bc6 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -363,12 +363,12 @@ function _has_color_diagnostics(self)
if io.isatty() and (colors.color8() or colors.color256()) then
local theme = colors.theme()
if theme and theme:name() ~= "plain" then
- -- for clang
- if self:has_flags("-fcolor-diagnostics", "cxflags") then
- colors_diagnostics = "-fcolor-diagnostics"
-- for gcc
- elseif self:has_flags("-fdiagnostics-color=always", "cxflags") then
+ if self:has_flags("-fdiagnostics-color=always", "cxflags") then
colors_diagnostics = "-fdiagnostics-color=always"
+ -- for clang
+ elseif self:has_flags("-fcolor-diagnostics", "cxflags") then
+ colors_diagnostics = "-fcolor-diagnostics"
end
end
end