waf: enable networking by default when supported, and disable with --disable-networking

This commit is contained in:
Andrew Tridgell 2023-11-17 06:09:56 +11:00 committed by Tom Pittenger
parent 31fd43ba25
commit aec605b020
2 changed files with 7 additions and 4 deletions

View File

@ -148,8 +148,8 @@ class Board:
)
cfg.msg("Enabled custom controller", 'no', color='YELLOW')
if cfg.options.enable_networking:
env.CXXFLAGS += ['-DAP_NETWORKING_ENABLED=1']
if cfg.options.disable_networking:
env.CXXFLAGS += ['-DAP_NETWORKING_ENABLED=0']
if cfg.options.enable_networking_tests:
env.CXXFLAGS += ['-DAP_NETWORKING_TESTS_ENABLED=1']
@ -674,6 +674,9 @@ class sitl(Board):
'-Werror=missing-declarations',
]
if not cfg.options.disable_networking:
env.CXXFLAGS += ['-DAP_NETWORKING_ENABLED=1']
if cfg.options.ubsan or cfg.options.ubsan_abort:
env.CXXFLAGS += [
"-fsanitize=undefined",

View File

@ -269,8 +269,8 @@ submodules at specific revisions.
g.add_option('--enable-dds', action='store_true',
help="Enable the dds client to connect with ROS2/DDS.")
g.add_option('--enable-networking', action='store_true',
help="Enable the networking code")
g.add_option('--disable-networking', action='store_true',
help="Disable the networking API code")
g.add_option('--enable-networking-tests', action='store_true',
help="Enable the networking test code. Automatically enables networking.")