Waf: Modify build directory define if heli build command is given
This commit is contained in:
parent
7c20658acf
commit
7fab70b8f1
@ -139,7 +139,7 @@ def ap_library(bld, library, vehicle):
|
|||||||
kw.update(
|
kw.update(
|
||||||
name=_vehicle_tgen_name(library, vehicle),
|
name=_vehicle_tgen_name(library, vehicle),
|
||||||
source=source,
|
source=source,
|
||||||
defines=ap.get_legacy_defines(vehicle),
|
defines=ap.get_legacy_defines(vehicle, bld),
|
||||||
idx=_vehicle_index(vehicle),
|
idx=_vehicle_index(vehicle),
|
||||||
)
|
)
|
||||||
bld.objects(**kw)
|
bld.objects(**kw)
|
||||||
|
@ -109,7 +109,16 @@ COMMON_VEHICLE_DEPENDENT_LIBRARIES = [
|
|||||||
'AP_FETtecOneWire',
|
'AP_FETtecOneWire',
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_legacy_defines(sketch_name):
|
def get_legacy_defines(sketch_name, bld):
|
||||||
|
# If we are building heli, we adjust the build directory define so that
|
||||||
|
# we do not need to actually split heli and copter directories
|
||||||
|
if bld.cmd == 'heli' or 'heli' in bld.targets:
|
||||||
|
return [
|
||||||
|
'APM_BUILD_DIRECTORY=APM_BUILD_Heli',
|
||||||
|
'SKETCH="' + sketch_name + '"',
|
||||||
|
'SKETCHNAME="' + sketch_name + '"',
|
||||||
|
]
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'APM_BUILD_DIRECTORY=APM_BUILD_' + sketch_name,
|
'APM_BUILD_DIRECTORY=APM_BUILD_' + sketch_name,
|
||||||
'SKETCH="' + sketch_name + '"',
|
'SKETCH="' + sketch_name + '"',
|
||||||
@ -253,7 +262,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, bld))
|
||||||
|
|
||||||
kw['features'] = kw.get('features', []) + bld.env.AP_PROGRAM_FEATURES
|
kw['features'] = kw.get('features', []) + bld.env.AP_PROGRAM_FEATURES
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user