mirror of https://github.com/ArduPilot/ardupilot
waf: added -Werror configure option
for building with error on any warning
This commit is contained in:
parent
6222649e37
commit
f352b6d107
|
@ -122,6 +122,7 @@ class Board:
|
||||||
'-Werror=parentheses',
|
'-Werror=parentheses',
|
||||||
'-Werror=format-extra-args',
|
'-Werror=format-extra-args',
|
||||||
'-Werror=ignored-qualifiers',
|
'-Werror=ignored-qualifiers',
|
||||||
|
'-DARDUPILOT_BUILD',
|
||||||
]
|
]
|
||||||
|
|
||||||
if cfg.options.scripting_checks:
|
if cfg.options.scripting_checks:
|
||||||
|
@ -205,6 +206,7 @@ class Board:
|
||||||
'-Wfatal-errors',
|
'-Wfatal-errors',
|
||||||
'-Wno-trigraphs',
|
'-Wno-trigraphs',
|
||||||
'-Werror=parentheses',
|
'-Werror=parentheses',
|
||||||
|
'-DARDUPILOT_BUILD',
|
||||||
]
|
]
|
||||||
|
|
||||||
if 'clang++' in cfg.env.COMPILER_CXX:
|
if 'clang++' in cfg.env.COMPILER_CXX:
|
||||||
|
@ -249,6 +251,15 @@ class Board:
|
||||||
'-Werror=implicit-fallthrough',
|
'-Werror=implicit-fallthrough',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if cfg.options.Werror:
|
||||||
|
errors = ['-Werror',
|
||||||
|
'-Werror=missing-declarations',
|
||||||
|
'-Werror=float-equal',
|
||||||
|
'-Werror=undef',
|
||||||
|
]
|
||||||
|
env.CFLAGS += errors
|
||||||
|
env.CXXFLAGS += errors
|
||||||
|
|
||||||
if cfg.env.DEBUG:
|
if cfg.env.DEBUG:
|
||||||
env.CXXFLAGS += [
|
env.CXXFLAGS += [
|
||||||
'-g',
|
'-g',
|
||||||
|
@ -481,11 +492,6 @@ class chibios(Board):
|
||||||
'-Wframe-larger-than=1300',
|
'-Wframe-larger-than=1300',
|
||||||
'-fsingle-precision-constant',
|
'-fsingle-precision-constant',
|
||||||
'-Wno-attributes',
|
'-Wno-attributes',
|
||||||
'-Wno-error=double-promotion',
|
|
||||||
'-Wno-error=missing-declarations',
|
|
||||||
'-Wno-error=float-equal',
|
|
||||||
'-Wno-error=undef',
|
|
||||||
'-Wno-error=cpp',
|
|
||||||
'-fno-exceptions',
|
'-fno-exceptions',
|
||||||
'-Wall',
|
'-Wall',
|
||||||
'-Wextra',
|
'-Wextra',
|
||||||
|
@ -521,6 +527,15 @@ class chibios(Board):
|
||||||
'-D__USE_CMSIS',
|
'-D__USE_CMSIS',
|
||||||
'-Werror=deprecated-declarations'
|
'-Werror=deprecated-declarations'
|
||||||
]
|
]
|
||||||
|
if not cfg.options.Werror:
|
||||||
|
env.CFLAGS += [
|
||||||
|
'-Wno-error=double-promotion',
|
||||||
|
'-Wno-error=missing-declarations',
|
||||||
|
'-Wno-error=float-equal',
|
||||||
|
'-Wno-error=undef',
|
||||||
|
'-Wno-error=cpp',
|
||||||
|
]
|
||||||
|
|
||||||
env.CXXFLAGS += env.CFLAGS + [
|
env.CXXFLAGS += env.CFLAGS + [
|
||||||
'-fno-rtti',
|
'-fno-rtti',
|
||||||
'-fno-threadsafe-statics',
|
'-fno-threadsafe-statics',
|
||||||
|
|
5
wscript
5
wscript
|
@ -76,6 +76,11 @@ def options(opt):
|
||||||
default=False,
|
default=False,
|
||||||
help='Configure as debug variant.')
|
help='Configure as debug variant.')
|
||||||
|
|
||||||
|
g.add_option('--Werror',
|
||||||
|
action='store_true',
|
||||||
|
default=False,
|
||||||
|
help='build with -Werror.')
|
||||||
|
|
||||||
g.add_option('--toolchain',
|
g.add_option('--toolchain',
|
||||||
action='store',
|
action='store',
|
||||||
default=None,
|
default=None,
|
||||||
|
|
Loading…
Reference in New Issue