mirror of https://github.com/ArduPilot/ardupilot
Tools: ardupilotwaf: include sfml-audio
This commit is contained in:
parent
9c26b5bb9c
commit
156d580bcd
|
@ -346,6 +346,11 @@ class sitl(Board):
|
|||
if fnmatch.fnmatch(f, "font*bin"):
|
||||
env.ROMFS_FILES += [(f,'libraries/AP_OSD/fonts/'+f)]
|
||||
|
||||
if cfg.options.enable_sfml_audio:
|
||||
if not cfg.check_SFML_Audio(env):
|
||||
cfg.fatal("Failed to find SFML Audio libraries")
|
||||
env.CXXFLAGS += ['-DWITH_SITL_TONEALARM']
|
||||
|
||||
if cfg.options.sitl_flash_storage:
|
||||
env.CXXFLAGS += ['-DSTORAGE_USE_FLASH=1']
|
||||
|
||||
|
|
|
@ -260,3 +260,27 @@ def check_SFML(cfg, env):
|
|||
env.LIB += libs
|
||||
return True
|
||||
|
||||
|
||||
@conf
|
||||
def check_SFML_Audio(cfg, env):
|
||||
if not cfg.options.enable_sfml_audio:
|
||||
cfg.msg("Checking for SFML audio:", 'disabled', color='YELLOW')
|
||||
return False
|
||||
libs = ['sfml-audio']
|
||||
for lib in libs:
|
||||
if not cfg.check(compiler='cxx', lib=lib, mandatory=False,
|
||||
global_define=True):
|
||||
cfg.fatal("Missing SFML libraries - please install libsfml-dev")
|
||||
return False
|
||||
|
||||
# see if we need Audio.hpp or Audio.h
|
||||
if not cfg.check(compiler='cxx',
|
||||
fragment='''#include <SFML/Audio.hpp>\nint main() {}''', define_name="HAVE_SFML_AUDIO_HPP",
|
||||
msg="Checking for Audio.hpp", mandatory=False):
|
||||
if not cfg.check(compiler='cxx', fragment='''#include <SFML/Audio.h>\nint main() {}''', define_name="HAVE_SFML_AUDIO_H",
|
||||
msg="Checking for Audio.h", mandatory=False):
|
||||
cfg.fatal("Missing SFML headers SFML/Audio.hpp or SFML/Audio.h")
|
||||
return False
|
||||
env.LIB += libs
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in New Issue