Add a new option '-E' for treating all compiler warnings as errors.
Eventually this will pass 'KCFLAGS=-Werror' to Kbuild.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
gnu_make='make', checkout=True, show_unknown=True, step=1,
no_subdirs=False, full_path=False, verbose_build=False,
incremental=False, per_board_out_dir=False,
- config_only=False, squash_config_y=False):
+ config_only=False, squash_config_y=False,
+ warnings_as_errors=False):
"""Create a new Builder object
Args:
board rather than a thread-specific directory
config_only: Only configure each build, don't build it
squash_config_y: Convert CONFIG options with the value 'y' to '1'
+ warnings_as_errors: Treat all compiler warnings as errors
"""
self.toolchains = toolchains
self.base_dir = base_dir
if not self.squash_config_y:
self.config_filenames += EXTRA_CONFIG_FILENAMES
+ self.warnings_as_errors = warnings_as_errors
self.col = terminal.Color()
self._re_function = re.compile('(.*): In function.*')
args.append('-s')
if self.builder.num_jobs is not None:
args.extend(['-j', str(self.builder.num_jobs)])
+ if self.builder.warnings_as_errors:
+ args.append('KCFLAGS=-Werror')
config_args = ['%s_defconfig' % brd.target]
config_out = ''
args.extend(self.builder.toolchains.GetMakeArguments(brd))
help="Don't build, just configure each commit")
parser.add_option('-e', '--show_errors', action='store_true',
default=False, help='Show errors and warnings')
+ parser.add_option('-E', '--warnings-as-errors', action='store_true',
+ default=False, help='Treat all compiler warnings as errors')
parser.add_option('-f', '--force-build', dest='force_build',
action='store_true', default=False,
help='Force build of boards even if already built')
incremental=options.incremental,
per_board_out_dir=options.per_board_out_dir,
config_only=options.config_only,
- squash_config_y=not options.preserve_config_y)
+ squash_config_y=not options.preserve_config_y,
+ warnings_as_errors=options.warnings_as_errors)
builder.force_config_on_failure = not options.quick
if make_func:
builder.do_make = make_func