From 7daa276769a50790af49c7b6c6e781d3a84758bd Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Wed, 27 Oct 2021 09:06:04 +0100 Subject: [PATCH] waf: stricter lua bindings build processing --- Tools/ardupilotwaf/ap_library.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Tools/ardupilotwaf/ap_library.py b/Tools/ardupilotwaf/ap_library.py index 03aaa4e2ba..9d3e67cb4a 100644 --- a/Tools/ardupilotwaf/ap_library.py +++ b/Tools/ardupilotwaf/ap_library.py @@ -57,6 +57,11 @@ _vehicle_macros = ['SKETCHNAME', 'SKETCH', 'APM_BUILD_DIRECTORY', 'AP_NavEKF3_core.h', 'lua_generated_bindings.h'] _macros_re = re.compile(r'\b(%s)\b' % '|'.join(_vehicle_macros)) +# some cpp files are not available at the time we run this check so need to be +# unilaterally added +_vehicle_cpp_need_macros = ['lua_generated_bindings.cpp'] +_macros_cpp_re = re.compile(r'\b(%s)\b' % '|'.join(_vehicle_cpp_need_macros)) + def _remove_comments(s): return c_preproc.re_cpp.sub(c_preproc.repl, s) @@ -66,15 +71,10 @@ def _depends_on_vehicle(bld, source_node): if not bld.env.BUILDROOT: bld.env.BUILDROOT = bld.bldnode.make_node('').abspath() - if path.startswith(bld.env.BUILDROOT) or path.startswith("build.tmp.binaries/"): - _depends_on_vehicle_cache[path] = False - if path.startswith("build/") or path.startswith(bld.env.BUILDROOT): - # allow vehicle dependend #if in cpp generated in build/ - # only scripting bindings currently + if _macros_cpp_re.search(path) is not None: _depends_on_vehicle_cache[path] = True - if path not in _depends_on_vehicle_cache: try: s = _remove_comments(source_node.read())