diff options
author | Chris Johns <chrisj@rtems.org> | 2023-04-19 19:02:22 -1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2023-04-20 15:27:25 +1000 |
commit | 2aaf97652272e6ddc5b7a7975dd1e5cf4c23dc65 (patch) | |
tree | 2b1dfa99cf6c7a5672bea249318a545acbcba30f | |
parent | 6b9c8b4e8d9d1fa603c54b146e8a6f51fe5ff79f (diff) |
waf: Enable warnings as an option
-rw-r--r-- | netlegacy.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/netlegacy.py b/netlegacy.py index 9f27ffc..3ce54c6 100644 --- a/netlegacy.py +++ b/netlegacy.py @@ -104,6 +104,10 @@ def options(opt): default='-O2', dest='optimization', help='Optimaization level (default: %default)') + copts.add_option('--enable-warnings', + action='store_true', + dest='warnings', + help='Enable warnings for all sources (default: %default)') def bsp_configure(conf, arch_bsp, mandatory=True): @@ -129,6 +133,11 @@ def bsp_configure(conf, arch_bsp, mandatory=True): ] + [str(conf.path.find_node(i)) for i in includes] + conf.env.IFLAGS conf.env.OPTIMIZATION = [conf.options.optimization] + if conf.options.warnings: + warnings = '-Wall' + else: + warnings = '-w' + conf.env.WARNINGS = [warnings] # # BSPs must define: # - RTEMS_BSP_NETWORK_DRIVER_NAME @@ -156,16 +165,18 @@ def build(bld): version_header(bld) net_config_header(bld) + cflags = bld.env.OPTIMIZATION + bld.env.WARNINGS + ['-g'] + if ab in bsp_drivers.source: bld(target='bspobjs', features='c', - cflags=bld.env.OPTIMIZATION + ['-g'], + cflags=cflags, includes=bld.env.IFLAGS, source=bsp_drivers.source[ab]) bld(target='netobjs', features='c', - cflags=bld.env.OPTIMIZATION + ['-g'], + cflags=cflags, includes=bld.env.IFLAGS, defines=['IN_HISTORICAL_NETS=1'], source=netsources.source.network) @@ -174,14 +185,14 @@ def build(bld): bld.stlib(target='pppd', features='c', - cflags=bld.env.OPTIMIZATION + ['-g'], + cflags=cflags, includes=bld.env.IFLAGS, use=['networking'], source=netsources.source.pppd) bld.stlib(target='nfs', features='c', - cflags=bld.env.OPTIMIZATION + ['-g'], + cflags=cflags, includes=bld.env.IFLAGS, use=['networking'], source=netsources.source.nfsclient) |