waf: make get_legacy_defines() "public"

That function will be used by an upcoming separate tool.
This commit is contained in:
Gustavo Jose de Sousa 2016-07-25 17:38:38 -03:00 committed by Lucas De Marchi
parent f2dec971e7
commit 2e1ac0de8d
1 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ COMMON_VEHICLE_DEPENDENT_LIBRARIES = [
'AP_ICEngine', 'AP_ICEngine',
] ]
def _get_legacy_defines(sketch_name): def get_legacy_defines(sketch_name):
return [ return [
'APM_BUILD_DIRECTORY=APM_BUILD_' + sketch_name, 'APM_BUILD_DIRECTORY=APM_BUILD_' + sketch_name,
'SKETCH="' + sketch_name + '"', 'SKETCH="' + sketch_name + '"',
@ -111,7 +111,7 @@ def ap_program(bld,
program_name = bld.path.name program_name = bld.path.name
if use_legacy_defines: if use_legacy_defines:
kw['defines'].extend(_get_legacy_defines(bld.path.name)) kw['defines'].extend(get_legacy_defines(bld.path.name))
kw['cxxflags'] = kw.get('cxxflags', []) + ['-include', 'ap_config.h'] kw['cxxflags'] = kw.get('cxxflags', []) + ['-include', 'ap_config.h']
kw['features'] = kw.get('features', []) + bld.env.AP_PROGRAM_FEATURES kw['features'] = kw.get('features', []) + bld.env.AP_PROGRAM_FEATURES
@ -185,7 +185,7 @@ def ap_stlib(bld, **kw):
kw['features'] = kw.get('features', []) + bld.env.AP_STLIB_FEATURES kw['features'] = kw.get('features', []) + bld.env.AP_STLIB_FEATURES
kw['source'] = sources kw['source'] = sources
kw['target'] = kw['name'] kw['target'] = kw['name']
kw['defines'] = _get_legacy_defines(kw['ap_vehicle']) kw['defines'] = get_legacy_defines(kw['ap_vehicle'])
kw['idx'] = _get_next_idx() kw['idx'] = _get_next_idx()
bld.stlib(**kw) bld.stlib(**kw)