mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 12:14:10 -04:00
waf: added --osd configure option
to allow boards with no builtin OSD to use MSP OSD
This commit is contained in:
parent
cea2eadd16
commit
7c579c4814
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
import sys, os
|
import sys, os
|
||||||
|
import fnmatch
|
||||||
|
|
||||||
import waflib
|
import waflib
|
||||||
from waflib import Utils
|
from waflib import Utils
|
||||||
@ -310,6 +311,12 @@ class Board:
|
|||||||
if cfg.options.disable_ekf3:
|
if cfg.options.disable_ekf3:
|
||||||
env.CXXFLAGS += ['-DHAL_NAVEKF3_AVAILABLE=0']
|
env.CXXFLAGS += ['-DHAL_NAVEKF3_AVAILABLE=0']
|
||||||
|
|
||||||
|
if cfg.options.osd:
|
||||||
|
env.CXXFLAGS += ['-DOSD_ENABLED=1']
|
||||||
|
for f in os.listdir('libraries/AP_OSD/fonts'):
|
||||||
|
if fnmatch.fnmatch(f, "font*bin"):
|
||||||
|
env.ROMFS_FILES += [(f,'libraries/AP_OSD/fonts/'+f)]
|
||||||
|
|
||||||
def pre_build(self, bld):
|
def pre_build(self, bld):
|
||||||
'''pre-build hook that gets called before dynamic sources'''
|
'''pre-build hook that gets called before dynamic sources'''
|
||||||
if bld.env.ROMFS_FILES:
|
if bld.env.ROMFS_FILES:
|
||||||
@ -437,7 +444,6 @@ class sitl(Board):
|
|||||||
if not cfg.check_SFML(env):
|
if not cfg.check_SFML(env):
|
||||||
cfg.fatal("Failed to find SFML libraries")
|
cfg.fatal("Failed to find SFML libraries")
|
||||||
|
|
||||||
import fnmatch
|
|
||||||
if cfg.options.sitl_osd:
|
if cfg.options.sitl_osd:
|
||||||
env.CXXFLAGS += ['-DWITH_SITL_OSD','-DOSD_ENABLED=1']
|
env.CXXFLAGS += ['-DWITH_SITL_OSD','-DOSD_ENABLED=1']
|
||||||
for f in os.listdir('libraries/AP_OSD/fonts'):
|
for f in os.listdir('libraries/AP_OSD/fonts'):
|
||||||
|
4
wscript
4
wscript
@ -188,6 +188,10 @@ configuration in order to save typing.
|
|||||||
default=False,
|
default=False,
|
||||||
help="Enable SFML audio library")
|
help="Enable SFML audio library")
|
||||||
|
|
||||||
|
g.add_option('--osd', action='store_true',
|
||||||
|
default=False,
|
||||||
|
help="Enable OSD support")
|
||||||
|
|
||||||
g.add_option('--sitl-osd', action='store_true',
|
g.add_option('--sitl-osd', action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
help="Enable SITL OSD")
|
help="Enable SITL OSD")
|
||||||
|
Loading…
Reference in New Issue
Block a user