waf: ardupilotwaf: allow to build ap_program as a static library

In the upcoming build for PX4 boards, we will pass down the program a single
static library to PX4 Firmware's cmake build system. This patch is partially
providing a way to do that: the configuration for PX4 will define the
AP_PROGRAM_AS_STLIB environment variable.
This commit is contained in:
Gustavo Jose de Sousa 2016-02-25 12:50:41 +00:00 committed by Lucas De Marchi
parent 32402b93af
commit 45d1af8833

View File

@ -104,12 +104,17 @@ def ap_program(bld, program_group='bin',
kw['features'] = kw.get('features', []) + bld.env.AP_PROGRAM_FEATURES kw['features'] = kw.get('features', []) + bld.env.AP_PROGRAM_FEATURES
if bld.env.STATIC_LINKING:
kw['features'].append('static_linking')
name = os.path.join(program_group, program_name) name = os.path.join(program_group, program_name)
tg = bld.program( tg_constructor = bld.program
if bld.env.AP_PROGRAM_AS_STLIB:
tg_constructor = bld.stlib
else:
if bld.env.STATIC_LINKING:
kw['features'].append('static_linking')
tg = tg_constructor(
target='#%s' % name, target='#%s' % name,
name=name, name=name,
**kw **kw