diff mbox series

[1/4] main: add an argument for showing warnings as errors

Message ID 20261013-warn-as-errors-v1-1-ab3658758ceb@bootlin.com
State New
Headers show
Series Add -W to treat warnings as errors | expand

Commit Message

Antonin Godard Oct. 13, 2026, 12:13 p.m. UTC
Add -W/--warnings-as-errors to make it possible to turn warnings into
errors. The werror boolean should be used by UIs to turn their warnings
into errors.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 lib/bb/main.py | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/lib/bb/main.py b/lib/bb/main.py
index 73a66468fef..7c65dfff1af 100755
--- a/lib/bb/main.py
+++ b/lib/bb/main.py
@@ -256,6 +256,9 @@  def create_bitbake_parser():
                         help="Output less log message data to the terminal. You can specify this "
                              "more than once.")
 
+    logging_group.add_argument("-W", "--warnings-as-errors", action="store_true", dest="werror",
+                        help="Treat warnings as errors.")
+
     logging_group.add_argument("-w", "--write-log", dest="writeeventlog",
                         default=os.environ.get("BBEVENTLOG"),
                         help="Writes the event log of the build to a bitbake event json file. "