diff --git a/Tools/ardupilotwaf/ardupilotwaf.py b/Tools/ardupilotwaf/ardupilotwaf.py index ebef10c695..7672c04f41 100644 --- a/Tools/ardupilotwaf/ardupilotwaf.py +++ b/Tools/ardupilotwaf/ardupilotwaf.py @@ -247,7 +247,6 @@ def ap_program(bld, if use_legacy_defines: kw['defines'].extend(get_legacy_defines(bld.path.name)) - kw['cxxflags'] = kw.get('cxxflags', []) + ['-include', 'ap_config.h'] kw['features'] = kw.get('features', []) + bld.env.AP_PROGRAM_FEATURES program_groups = Utils.to_list(program_groups) diff --git a/wscript b/wscript index 7812ed6f58..0f92a04ddc 100644 --- a/wscript +++ b/wscript @@ -364,6 +364,9 @@ def configure(cfg): cfg.write_config_header(os.path.join(cfg.variant, 'ap_config.h')) + # add in generated flags + cfg.env.CXXFLAGS += ['-include', 'ap_config.h'] + _collect_autoconfig_files(cfg) def collect_dirs_to_recurse(bld, globs, **kw):