From 355269115e109aee70992b32b380481ee7b6ce08 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 1 Jul 2018 20:10:08 +1000 Subject: [PATCH] waf: support --enable-osd option --- Tools/ardupilotwaf/boards.py | 15 ++++++++++++++- wscript | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index b128310e1b..08e1325116 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -262,6 +262,11 @@ class sitl(Board): 'SITL', ] + if cfg.options.enable_osd: + env.LIB += ['sfml-graphics', 'sfml-window','sfml-system'] + env.CXXFLAGS += ['-DWITH_SITL_OSD','-DOSD_ENABLED=ENABLED','-DHAL_HAVE_AP_ROMFS_EMBEDDED_H'] + self.embed_files(cfg, [('osd_font.bin','libraries/AP_OSD/fonts/clarity.bin')]) + if sys.platform == 'cygwin': env.LIB += [ 'winmm', @@ -274,7 +279,15 @@ class sitl(Board): env.CXXFLAGS += [ '-fno-slp-vectorize' # compiler bug when trying to use SLP ] - + + def embed_files(self, cfg, files): + '''embed some files using AP_ROMFS''' + header = cfg.bldnode.make_node('sitl/ap_romfs_embedded.h').abspath() + paths = [] + embed_path = cfg.srcnode.make_node('libraries/AP_HAL_ChibiOS/hwdef/scripts').abspath() + sys.path.append(embed_path) + import embed + embed.create_embedded_h(header, files) class chibios(Board): toolchain = 'arm-none-eabi' diff --git a/wscript b/wscript index 370c710de6..878be746cb 100644 --- a/wscript +++ b/wscript @@ -138,6 +138,10 @@ configuration in order to save typing. default=False, help="Disable compilation and test execution") + g.add_option('--enable-osd', action='store_true', + default=False, + help="Enable OSD display") + g.add_option('--static', action='store_true', default=False,