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:
parent
32402b93af
commit
45d1af8833
@ -104,12 +104,17 @@ def ap_program(bld, program_group='bin',
|
||||
|
||||
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)
|
||||
|
||||
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,
|
||||
name=name,
|
||||
**kw
|
||||
|
Loading…
Reference in New Issue
Block a user