From f6715cdaa076be57ba9bf48b89516ed717c8e808 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Mon, 14 Jun 2021 16:37:27 +0530 Subject: [PATCH] waf: generate SOAP wsdl into cpp code --- Tools/ardupilotwaf/boards.py | 30 ++++++++++++++++++++++++++++-- wscript | 8 ++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index ec378b65da..9b997b67a2 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -67,7 +67,34 @@ class Board: # allow GCS disable for AP_DAL example if cfg.options.no_gcs: env.CXXFLAGS += ['-DHAL_NO_GCS=1'] - + + # setup for supporting onvif cam control + if cfg.options.enable_onvif: + cfg.recurse('libraries/AP_ONVIF') + env.ENABLE_ONVIF = True + env.ROMFS_FILES += [('scripts/ONVIF_Camera_Control.lua', + 'libraries/AP_Scripting/applets/ONVIF_Camera_Control.lua')] + env.DEFINES.update( + ENABLE_ONVIF=1, + SCRIPTING_ENABLE_DEFAULT=1, + ) + env.AP_LIBRARIES += [ + 'AP_ONVIF' + ] + env.CXXFLAGS += [ + '-Wno-shadow', + '-Wno-undef', + ] + if 'clang++' not in cfg.env.COMPILER_CXX: + env.CXXFLAGS += [ + '-Wno-suggest-override', + ] + else: + env.ENABLE_ONVIF = False + env.DEFINES.update( + ENABLE_ONVIF=0, + ) + d = env.get_merged_dict() # Always prepend so that arguments passed in the command line get # the priority. @@ -444,7 +471,6 @@ class sitl(Board): AP_SCRIPTING_CHECKS = 1, # SITL should always do runtime scripting checks ) - if self.with_can: cfg.define('HAL_NUM_CAN_IFACES', 2) cfg.define('UAVCAN_EXCEPTIONS', 0) diff --git a/wscript b/wscript index 0ef07b313d..ee95965666 100644 --- a/wscript +++ b/wscript @@ -164,6 +164,10 @@ submodules at specific revisions. default=True, help="Enable runtime scripting sanity checks") + g.add_option('--enable-onvif', action='store_true', + default=False, + help="Enables and sets up ONVIF camera control") + g = opt.ap_groups['linux'] linux_options = ('--prefix', '--destdir', '--bindir', '--libdir') @@ -527,6 +531,7 @@ def _build_dynamic_sources(bld): ] ) + def write_version_header(tsk): bld = tsk.generator.bld return bld.write_version_header(tsk.outputs[0].abspath()) @@ -600,6 +605,9 @@ def _build_recursion(bld): dirs_to_recurse.append('libraries/AP_Scripting') + if bld.env.ENABLE_ONVIF: + dirs_to_recurse.append('libraries/AP_ONVIF') + for p in hal_dirs_patterns: dirs_to_recurse += collect_dirs_to_recurse( bld,