diff options
author | Rob Mohr <mohrr@google.com> | 2024-01-31 15:50:12 +0000 |
---|---|---|
committer | Rob Mohr <mohrr@google.com> | 2024-01-31 15:50:12 +0000 |
commit | 2f985e8ce1ff67b458b6de37d4cb2c139e91c8c4 (patch) | |
tree | 9fb162379fd3c1690e4060a4e0500b3dad8b61ef /pw_build | |
parent | 9fcd145216a27e4ad89f022fadf2ba1f2fe12c4e (diff) | |
download | pigweed-2f985e8ce1ff67b458b6de37d4cb2c139e91c8c4.tar.gz |
pw_{build,presubmit}: Support disabling colors
Support running clang without -fdiagnostics-color in automated builds.
Change-Id: I5b1cbd844f48ff6392397525333086fad789075d
Bug: b/323056074
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/189611
Reviewed-by: Armando Montanez <amontanez@google.com>
Diffstat (limited to 'pw_build')
-rw-r--r-- | pw_build/BUILD.gn | 12 | ||||
-rw-r--r-- | pw_build/defaults.gni | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/pw_build/BUILD.gn b/pw_build/BUILD.gn index 3537c5a26..a209c7b13 100644 --- a/pw_build/BUILD.gn +++ b/pw_build/BUILD.gn @@ -27,11 +27,13 @@ import("target_types.gni") # the CMake flags pw_build/CMakeLists.txt. config("colorize_output") { - cflags = [ - # Colorize output. Ninja's Clang invocation disables color by default. - "-fdiagnostics-color", - ] - ldflags = cflags + if (pw_build_COLORIZE_OUTPUT) { + cflags = [ + # Colorize output. Ninja's Clang invocation disables color by default. + "-fdiagnostics-color", + ] + ldflags = cflags + } } config("debugging") { diff --git a/pw_build/defaults.gni b/pw_build/defaults.gni index f1eb0aa71..5fb793b13 100644 --- a/pw_build/defaults.gni +++ b/pw_build/defaults.gni @@ -56,6 +56,9 @@ declare_args() { # # Explicitly setting a target's visibility overrides this default. pw_build_DEFAULT_VISIBILITY = [ "*" ] + + # Controls whether compilers and other tools are told to use colorized output. + pw_build_COLORIZE_OUTPUT = true } # These are the default configs automatically applied to every pw_* C/C++ build |