diff --git a/Tools/ardupilotwaf/ap_library.py b/Tools/ardupilotwaf/ap_library.py index 4ed61fdf36..a2a05238ee 100644 --- a/Tools/ardupilotwaf/ap_library.py +++ b/Tools/ardupilotwaf/ap_library.py @@ -62,6 +62,9 @@ _depends_on_vehicle_cache = {} def _depends_on_vehicle(bld, source_node): path = source_node.srcpath() + if path.startswith('build/'): + _depends_on_vehicle_cache[path] = False + if path not in _depends_on_vehicle_cache: s = _remove_comments(source_node.read()) _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) + # 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: kw = dict(bld.env.AP_LIBRARIES_OBJECTS_KW) kw['features'] = kw.get('features', []) + ['ap_library_object'] @@ -209,3 +218,4 @@ def ap_library_register_for_check(self): def configure(cfg): cfg.env.AP_LIBRARIES_OBJECTS_KW = dict() + cfg.env.AP_LIB_EXTRA_SOURCES = dict()