diff options
| author | Jonathan Poelen <[email protected]> | 2021-01-18 01:27:24 +0100 |
|---|---|---|
| committer | Jonathan Poelen <[email protected]> | 2021-01-18 01:27:36 +0100 |
| commit | 892c52158eaf4259bf7b63e0a84eeffdbe930571 (patch) | |
| tree | 77c7e8f5094bffe61ed917ba7cad5fb86319f716 | |
| parent | 36e9370b50ed50d65f843a4a46afce1ad0ad2fbe (diff) | |
checks -fdiagnostics-color=always before -fcolor-diagnostics (supported by clang and gcc)
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 8 |
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 |
