Commit b6769d8c authored by tzik's avatar tzik Committed by Commit Bot

Add an option for clang-cl to emit clang style diagnostics

clang-cl's diagnostics messages are different to clang++ or gcc. That is
not very convenient for the editor support like Emacs compilation mode.

This CL adds a configuration flag, use_clang_diagnostics_format, to use
clang/gcc style diagnostics.

Change-Id: I92599c6025d36af7eff74454d58e2f74e516c627
Reviewed-on: https://chromium-review.googlesource.com/1061034
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584364}
parent cd4d9d7f
......@@ -37,6 +37,16 @@ declare_args() {
# "server" - Windows Server Applications
# "desktop" - Windows Desktop Applications
target_winuwp_family = "app"
# Set this to use clang style diagnostics format. Available only on clang.
# Tune this on for the editor integrations like Emacs compilation mode that
# match clang style error messages.
# E.g.:
# Without this, clang emits a diagnostic message like this:
# foo/bar.cc(12,34): error: something went wrong
# and with this switch, clang emits it like this:
# foo/bar.cc:12:34: error: something went wrong
use_clang_diagnostics_format = false
}
# This is included by reference in the //build/config/compiler config that
......@@ -93,6 +103,15 @@ config("compiler") {
]
}
if (is_clang && use_clang_diagnostics_format) {
cflags += [
"-Xclang",
"-fdiagnostics-format",
"-Xclang",
"clang",
]
}
# Clang runtime libraries, such as the sanitizer runtimes, live here.
lib_dirs = [ "$clang_base_path/lib/clang/$clang_version/lib/windows" ]
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment