ardupilot/Tools/AP_Periph/wscript

95 lines
2.7 KiB
Plaintext
Raw Normal View History

2019-05-26 22:46:41 -03:00
#!/usr/bin/env python
# encoding: utf-8
import fnmatch
import sys
try:
import em
except ImportError:
print("you need to install empy with 'python -m pip install empy'")
sys.exit(1)
try:
import pexpect
except ImportError:
print("you need to install pexpect with 'python -m pip install pexpect'")
sys.exit(1)
2019-05-26 22:46:41 -03:00
def build(bld):
targets = bld.ap_periph_boards()
valid_target = False
for t in targets:
if fnmatch.fnmatch(bld.env.BOARD, t):
valid_target = True
if not valid_target:
2019-05-26 22:46:41 -03:00
return
if bld.env.AP_PERIPH_HEAVY:
libraries = bld.ap_get_all_libraries()
libraries.extend(['AP_ADSB/sagetech-sdk'])
bld.env.DEFINES += ['HAL_BOARD_AP_PERIPH_HEAVY']
else:
libraries = ['AP_Common',
'AP_HAL',
'AP_HAL_Empty',
'AP_Math',
'AP_BoardConfig',
'AP_BattMonitor',
'AP_CANManager',
'AP_Param',
'StorageManager',
'AP_FlashStorage',
'AP_RAMTRON',
'AP_GPS',
'AP_SerialManager',
'AP_RTC',
'AP_Compass',
'AP_NMEA_Output',
'AP_Baro',
'Filter',
'AP_InternalError',
'AP_Airspeed',
'AP_RangeFinder',
'AP_ROMFS',
'AP_TemperatureSensor',
'AP_MSP',
'SRV_Channel',
'AP_Notify',
'AP_SerialLED',
'AP_Filesystem',
'AP_InertialSensor',
'AP_AccelCal',
'AP_Logger',
'AC_PID',
'AP_BLHeli',
'AP_ESC_Telem',
2022-06-03 08:00:14 -03:00
'AP_Stats',
'AP_EFI',
2022-08-11 05:03:47 -03:00
'AP_CheckFirmware',
2022-09-27 16:45:07 -03:00
'AP_Proximity',
]
2019-05-26 22:46:41 -03:00
bld.ap_stlib(
name= 'AP_Periph_libs',
dynamic_source='modules/DroneCAN/libcanard/dsdlc_generated/src/**.c',
2019-05-26 22:46:41 -03:00
ap_vehicle='AP_Periph',
ap_libraries= libraries,
use='dronecan',
2019-05-26 22:46:41 -03:00
exclude_src=[
'libraries/AP_HAL_ChibiOS/Storage.cpp'
]
)
# build external libcanard library
bld.stlib(source='../../modules/DroneCAN/libcanard/canard.c',
name='libcanard',
use='dronecan',
2019-05-26 22:46:41 -03:00
target='libcanard')
bld.ap_program(
program_name='AP_Periph',
use=['AP_Periph_libs', 'libcanard', 'dronecan'],
2019-05-26 22:46:41 -03:00
program_groups=['bin','AP_Periph'],
)