Browse Source

waf: added AP_LIB_EXTRA_SOURCES

used to allow building of dynamically generated library components
c415-sdk
Andrew Tridgell 5 years ago
parent
commit
be812f490f
  1. 10
      Tools/ardupilotwaf/ap_library.py

10
Tools/ardupilotwaf/ap_library.py

@ -62,6 +62,9 @@ _depends_on_vehicle_cache = {}
def _depends_on_vehicle(bld, source_node): def _depends_on_vehicle(bld, source_node):
path = source_node.srcpath() path = source_node.srcpath()
if path.startswith('build/'):
_depends_on_vehicle_cache[path] = False
if path not in _depends_on_vehicle_cache: if path not in _depends_on_vehicle_cache:
s = _remove_comments(source_node.read()) s = _remove_comments(source_node.read())
_depends_on_vehicle_cache[path] = _macros_re.search(s) is not None _depends_on_vehicle_cache[path] = _macros_re.search(s) is not None
@ -96,6 +99,12 @@ def ap_library(bld, library, vehicle):
src = library_dir.ant_glob(wildcard) src = library_dir.ant_glob(wildcard)
# allow for dynamically generated sources in a library that inherit the
# dependencies and includes
if library in bld.env.AP_LIB_EXTRA_SOURCES:
for s in bld.env.AP_LIB_EXTRA_SOURCES[library]:
src.append(bld.bldnode.find_or_declare(os.path.join('libraries', library, 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']
@ -209,3 +218,4 @@ def ap_library_register_for_check(self):
def configure(cfg): def configure(cfg):
cfg.env.AP_LIBRARIES_OBJECTS_KW = dict() cfg.env.AP_LIBRARIES_OBJECTS_KW = dict()
cfg.env.AP_LIB_EXTRA_SOURCES = dict()

Loading…
Cancel
Save