mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-07 00:18:29 -04:00
waf: ardupilotwaf: decorate build methods with @conf
Bind functions used in wscripts to build context. Additionally, a new function is created and also decorated with @conf, common_vehicle_libraries(), which returns COMMON_VEHICLE_DEPENDENT_LIBRARIES. This patch is a preparation for making wscripts use methods bound to the build context instead of using them directly from ardupilotwaf.
This commit is contained in:
parent
cf432e8b3e
commit
12cfe222eb
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from waflib import Logs, Options, Utils
|
from waflib import Logs, Options, Utils
|
||||||
|
from waflib.Configure import conf
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
SOURCE_EXTS = [
|
SOURCE_EXTS = [
|
||||||
@ -63,6 +64,7 @@ IGNORED_AP_LIBRARIES = [
|
|||||||
'GCS_Console',
|
'GCS_Console',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@conf
|
||||||
def get_all_libraries(bld):
|
def get_all_libraries(bld):
|
||||||
libraries = []
|
libraries = []
|
||||||
for lib_node in bld.srcnode.ant_glob('libraries/*', dir=True):
|
for lib_node in bld.srcnode.ant_glob('libraries/*', dir=True):
|
||||||
@ -75,6 +77,11 @@ def get_all_libraries(bld):
|
|||||||
libraries.extend(['AP_HAL', 'AP_HAL_Empty'])
|
libraries.extend(['AP_HAL', 'AP_HAL_Empty'])
|
||||||
return libraries
|
return libraries
|
||||||
|
|
||||||
|
@conf
|
||||||
|
def common_vehicle_libraries(bld):
|
||||||
|
return COMMON_VEHICLE_DEPENDENT_LIBRARIES
|
||||||
|
|
||||||
|
@conf
|
||||||
def ap_program(bld, blddestdir='bin',
|
def ap_program(bld, blddestdir='bin',
|
||||||
use_legacy_defines=True,
|
use_legacy_defines=True,
|
||||||
program_name=None,
|
program_name=None,
|
||||||
@ -103,6 +110,7 @@ def ap_program(bld, blddestdir='bin',
|
|||||||
**kw
|
**kw
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@conf
|
||||||
def example(bld, **kw):
|
def example(bld, **kw):
|
||||||
kw['blddestdir'] = 'examples'
|
kw['blddestdir'] = 'examples'
|
||||||
ap_program(bld, **kw)
|
ap_program(bld, **kw)
|
||||||
@ -124,6 +132,7 @@ def common_features(bld):
|
|||||||
features.append('static_linking')
|
features.append('static_linking')
|
||||||
return features
|
return features
|
||||||
|
|
||||||
|
@conf
|
||||||
def ap_stlib(bld, **kw):
|
def ap_stlib(bld, **kw):
|
||||||
if 'name' not in kw:
|
if 'name' not in kw:
|
||||||
bld.fatal('Missing name for ap_stlib')
|
bld.fatal('Missing name for ap_stlib')
|
||||||
@ -149,6 +158,7 @@ def ap_stlib(bld, **kw):
|
|||||||
|
|
||||||
bld.stlib(**kw)
|
bld.stlib(**kw)
|
||||||
|
|
||||||
|
@conf
|
||||||
def find_tests(bld, use=[]):
|
def find_tests(bld, use=[]):
|
||||||
if not bld.env.HAS_GTEST:
|
if not bld.env.HAS_GTEST:
|
||||||
return
|
return
|
||||||
@ -174,6 +184,7 @@ def find_tests(bld, use=[]):
|
|||||||
use_legacy_defines=False,
|
use_legacy_defines=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@conf
|
||||||
def find_benchmarks(bld, use=[]):
|
def find_benchmarks(bld, use=[]):
|
||||||
if not bld.env.HAS_GBENCHMARK:
|
if not bld.env.HAS_GBENCHMARK:
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user