waf: Add building DDS client to waf
* Had to ignore pre-commit hooks for isort and mypy since there are unrelated broken issues in the file Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com> Co-authored-by: Arsh Pratap <arshpratapofficial@gmail.com> Co-authored-by: Andrew Tridgell <andrew@tridgell.net>
This commit is contained in:
parent
d361fec745
commit
c7cac9abae
@ -118,6 +118,11 @@ def ap_library(bld, library, vehicle):
|
|||||||
for s in bld.env.AP_LIB_EXTRA_SOURCES[library]:
|
for s in bld.env.AP_LIB_EXTRA_SOURCES[library]:
|
||||||
src.append(bld.bldnode.find_or_declare(os.path.join('libraries', library, s)))
|
src.append(bld.bldnode.find_or_declare(os.path.join('libraries', library, s)))
|
||||||
|
|
||||||
|
# include the dependencies for XRCE-DDS
|
||||||
|
if len(bld.env.XRCE_DEPENDENCIES):
|
||||||
|
for s in bld.env.XRCE_DEPENDENCIES:
|
||||||
|
src.append(bld.bldnode.find_or_declare(s))
|
||||||
|
|
||||||
if not common_tg:
|
if not common_tg:
|
||||||
kw = dict(bld.env.AP_LIBRARIES_OBJECTS_KW)
|
kw = dict(bld.env.AP_LIBRARIES_OBJECTS_KW)
|
||||||
kw['features'] = kw.get('features', []) + ['ap_library_object']
|
kw['features'] = kw.get('features', []) + ['ap_library_object']
|
||||||
|
@ -134,6 +134,7 @@ def get_legacy_defines(sketch_name, bld):
|
|||||||
IGNORED_AP_LIBRARIES = [
|
IGNORED_AP_LIBRARIES = [
|
||||||
'doc',
|
'doc',
|
||||||
'AP_Scripting', # this gets explicitly included when it is needed and should otherwise never be globbed in
|
'AP_Scripting', # this gets explicitly included when it is needed and should otherwise never be globbed in
|
||||||
|
'AP_DDS',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,6 +75,20 @@ class Board:
|
|||||||
if cfg.options.no_gcs:
|
if cfg.options.no_gcs:
|
||||||
env.CXXFLAGS += ['-DHAL_GCS_ENABLED=0']
|
env.CXXFLAGS += ['-DHAL_GCS_ENABLED=0']
|
||||||
|
|
||||||
|
# configurations for XRCE-DDS
|
||||||
|
if cfg.options.enable_dds:
|
||||||
|
cfg.recurse('libraries/AP_DDS')
|
||||||
|
env.ENABLE_DDS = True
|
||||||
|
env.AP_LIBRARIES += [
|
||||||
|
'AP_DDS'
|
||||||
|
]
|
||||||
|
env.DEFINES.update(AP_DDS_ENABLED = 1)
|
||||||
|
# check for microxrceddsgen
|
||||||
|
cfg.find_program('microxrceddsgen',mandatory=True)
|
||||||
|
else:
|
||||||
|
env.ENABLE_DDS = False
|
||||||
|
env.DEFINES.update(AP_DDS_ENABLED = 0)
|
||||||
|
|
||||||
# setup for supporting onvif cam control
|
# setup for supporting onvif cam control
|
||||||
if cfg.options.enable_onvif:
|
if cfg.options.enable_onvif:
|
||||||
cfg.recurse('libraries/AP_ONVIF')
|
cfg.recurse('libraries/AP_ONVIF')
|
||||||
|
7
wscript
7
wscript
@ -251,6 +251,10 @@ submodules at specific revisions.
|
|||||||
default=False,
|
default=False,
|
||||||
help="Enables GPS logging")
|
help="Enables GPS logging")
|
||||||
|
|
||||||
|
g.add_option('--enable-dds', action='store_true',
|
||||||
|
help="Enable the dds client to connect with ROS2/DDS"
|
||||||
|
)
|
||||||
|
|
||||||
g = opt.ap_groups['linux']
|
g = opt.ap_groups['linux']
|
||||||
|
|
||||||
linux_options = ('--prefix', '--destdir', '--bindir', '--libdir')
|
linux_options = ('--prefix', '--destdir', '--bindir', '--libdir')
|
||||||
@ -672,6 +676,9 @@ def _build_dynamic_sources(bld):
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if bld.env.ENABLE_DDS:
|
||||||
|
bld.recurse("libraries/AP_DDS")
|
||||||
|
|
||||||
def write_version_header(tsk):
|
def write_version_header(tsk):
|
||||||
bld = tsk.generator.bld
|
bld = tsk.generator.bld
|
||||||
return bld.write_version_header(tsk.outputs[0].abspath())
|
return bld.write_version_header(tsk.outputs[0].abspath())
|
||||||
|
Loading…
Reference in New Issue
Block a user