Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve clang colors output #4875

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions xmake/modules/core/tools/clang_cl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ function _has_color_diagnostics(self)
elseif self:has_flags("-fdiagnostics-color=always", "cxflags") then
colors_diagnostics = "-fdiagnostics-color=always"
end

-- enable color output for windows, @see https://github.com/xmake-io/xmake-vscode/discussions/260
if colors_diagnostics and
self:has_flags("-fansi-escape-codes", "cxflags") then
colors_diagnostics = table.join(colors_diagnostics, "-fansi-escape-codes")
end
end
end
colors_diagnostics = colors_diagnostics or false
Expand Down
6 changes: 6 additions & 0 deletions xmake/modules/core/tools/gcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,12 @@ function _has_color_diagnostics(self)
elseif self:has_flags("-fcolor-diagnostics", "cxflags") then
colors_diagnostics = "-fcolor-diagnostics"
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
colors_diagnostics = colors_diagnostics or false
Expand Down