waf: ardupilotwaf: add program_dir option to ap_program()
That way we don't force other programs to be built on a directory of their program group name. The directory name defaults to the program group. We are separating those two concepts because of the upcoming support for multiple groups for a program.
This commit is contained in:
parent
a6868461c3
commit
22b0b7e833
@ -85,10 +85,12 @@ def ap_common_vehicle_libraries(bld):
|
||||
_grouped_programs = {}
|
||||
|
||||
@conf
|
||||
def ap_program(bld, program_group='bin',
|
||||
use_legacy_defines=True,
|
||||
program_name=None,
|
||||
**kw):
|
||||
def ap_program(bld,
|
||||
program_group='bin',
|
||||
program_dir=None,
|
||||
use_legacy_defines=True,
|
||||
program_name=None,
|
||||
**kw):
|
||||
if 'target' in kw:
|
||||
bld.fatal('Do not pass target for program')
|
||||
if 'defines' not in kw:
|
||||
@ -104,7 +106,10 @@ def ap_program(bld, program_group='bin',
|
||||
|
||||
kw['features'] = kw.get('features', []) + bld.env.AP_PROGRAM_FEATURES
|
||||
|
||||
name = os.path.join(program_group, program_name)
|
||||
if not program_dir:
|
||||
program_dir = program_group
|
||||
|
||||
name = os.path.join(program_dir, program_name)
|
||||
|
||||
tg_constructor = bld.program
|
||||
if bld.env.AP_PROGRAM_AS_STLIB:
|
||||
@ -118,7 +123,7 @@ def ap_program(bld, program_group='bin',
|
||||
target='#%s' % name,
|
||||
name=name,
|
||||
program_name=program_name,
|
||||
program_group=program_group,
|
||||
program_dir=program_dir,
|
||||
**kw
|
||||
)
|
||||
_grouped_programs.setdefault(program_group, []).append(tg)
|
||||
|
@ -168,7 +168,7 @@ def px4_firmware(self):
|
||||
_update_firmware_sig(fw_task, firmware)
|
||||
|
||||
fw_dest = self.bld.bldnode.make_node(
|
||||
os.path.join(self.program_group, '%s.px4' % self.program_name)
|
||||
os.path.join(self.program_dir, '%s.px4' % self.program_name)
|
||||
)
|
||||
git_hashes = self.create_task('px4_add_git_hashes', firmware, fw_dest)
|
||||
git_hashes.set_run_after(fw_task)
|
||||
|
Loading…
Reference in New Issue
Block a user