mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-28 01:51:33 +00:00
buildman: add option -E for treating compiler warnings as errors
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>
This commit is contained in:
parent
215bb1c147
commit
2371d1bcbf
4 changed files with 10 additions and 2 deletions
|
@ -212,7 +212,8 @@ class Builder:
|
||||||
gnu_make='make', checkout=True, show_unknown=True, step=1,
|
gnu_make='make', checkout=True, show_unknown=True, step=1,
|
||||||
no_subdirs=False, full_path=False, verbose_build=False,
|
no_subdirs=False, full_path=False, verbose_build=False,
|
||||||
incremental=False, per_board_out_dir=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
|
"""Create a new Builder object
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -237,6 +238,7 @@ class Builder:
|
||||||
board rather than a thread-specific directory
|
board rather than a thread-specific directory
|
||||||
config_only: Only configure each build, don't build it
|
config_only: Only configure each build, don't build it
|
||||||
squash_config_y: Convert CONFIG options with the value 'y' to '1'
|
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.toolchains = toolchains
|
||||||
self.base_dir = base_dir
|
self.base_dir = base_dir
|
||||||
|
@ -270,6 +272,7 @@ class Builder:
|
||||||
if not self.squash_config_y:
|
if not self.squash_config_y:
|
||||||
self.config_filenames += EXTRA_CONFIG_FILENAMES
|
self.config_filenames += EXTRA_CONFIG_FILENAMES
|
||||||
|
|
||||||
|
self.warnings_as_errors = warnings_as_errors
|
||||||
self.col = terminal.Color()
|
self.col = terminal.Color()
|
||||||
|
|
||||||
self._re_function = re.compile('(.*): In function.*')
|
self._re_function = re.compile('(.*): In function.*')
|
||||||
|
|
|
@ -216,6 +216,8 @@ class BuilderThread(threading.Thread):
|
||||||
args.append('-s')
|
args.append('-s')
|
||||||
if self.builder.num_jobs is not None:
|
if self.builder.num_jobs is not None:
|
||||||
args.extend(['-j', str(self.builder.num_jobs)])
|
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_args = ['%s_defconfig' % brd.target]
|
||||||
config_out = ''
|
config_out = ''
|
||||||
args.extend(self.builder.toolchains.GetMakeArguments(brd))
|
args.extend(self.builder.toolchains.GetMakeArguments(brd))
|
||||||
|
|
|
@ -32,6 +32,8 @@ def ParseArgs():
|
||||||
help="Don't build, just configure each commit")
|
help="Don't build, just configure each commit")
|
||||||
parser.add_option('-e', '--show_errors', action='store_true',
|
parser.add_option('-e', '--show_errors', action='store_true',
|
||||||
default=False, help='Show errors and warnings')
|
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',
|
parser.add_option('-f', '--force-build', dest='force_build',
|
||||||
action='store_true', default=False,
|
action='store_true', default=False,
|
||||||
help='Force build of boards even if already built')
|
help='Force build of boards even if already built')
|
||||||
|
|
|
@ -263,7 +263,8 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
|
||||||
incremental=options.incremental,
|
incremental=options.incremental,
|
||||||
per_board_out_dir=options.per_board_out_dir,
|
per_board_out_dir=options.per_board_out_dir,
|
||||||
config_only=options.config_only,
|
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
|
builder.force_config_on_failure = not options.quick
|
||||||
if make_func:
|
if make_func:
|
||||||
builder.do_make = make_func
|
builder.do_make = make_func
|
||||||
|
|
Loading…
Add table
Reference in a new issue