aboutsummaryrefslogtreecommitdiff
path: root/pw_build
diff options
context:
space:
mode:
authorRob Mohr <mohrr@google.com>2024-01-31 15:50:12 +0000
committerRob Mohr <mohrr@google.com>2024-01-31 15:50:12 +0000
commit2f985e8ce1ff67b458b6de37d4cb2c139e91c8c4 (patch)
tree9fb162379fd3c1690e4060a4e0500b3dad8b61ef /pw_build
parent9fcd145216a27e4ad89f022fadf2ba1f2fe12c4e (diff)
downloadpigweed-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.gn12
-rw-r--r--pw_build/defaults.gni3
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