From a136c281223bb59de6556c5319b677e511467ba7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 6 Jul 2024 09:13:11 +1000 Subject: [PATCH] waf: don't build CAN libraries if CAN not supported --- Tools/ardupilotwaf/ardupilotwaf.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Tools/ardupilotwaf/ardupilotwaf.py b/Tools/ardupilotwaf/ardupilotwaf.py index 1f5a628ff5..dbb2b0a00d 100644 --- a/Tools/ardupilotwaf/ardupilotwaf.py +++ b/Tools/ardupilotwaf/ardupilotwaf.py @@ -17,6 +17,13 @@ SOURCE_EXTS = [ '*.cpp', ] +COMMON_VEHICLE_DEPENDENT_CAN_LIBRARIES = [ + 'AP_CANManager', + 'AP_KDECAN', + 'AP_PiccoloCAN', + 'AP_PiccoloCAN/piccolo_protocol', +] + COMMON_VEHICLE_DEPENDENT_LIBRARIES = [ 'AP_Airspeed', 'AP_AccelCal', @@ -27,7 +34,6 @@ COMMON_VEHICLE_DEPENDENT_LIBRARIES = [ 'AP_BattMonitor', 'AP_BoardConfig', 'AP_Camera', - 'AP_CANManager', 'AP_Common', 'AP_Compass', 'AP_Declination', @@ -35,7 +41,6 @@ COMMON_VEHICLE_DEPENDENT_LIBRARIES = [ 'AP_HAL', 'AP_HAL_Empty', 'AP_InertialSensor', - 'AP_KDECAN', 'AP_Math', 'AP_Mission', 'AP_DAL', @@ -74,8 +79,6 @@ COMMON_VEHICLE_DEPENDENT_LIBRARIES = [ 'AP_SBusOut', 'AP_IOMCU', 'AP_Parachute', - 'AP_PiccoloCAN', - 'AP_PiccoloCAN/piccolo_protocol', 'AP_RAMTRON', 'AP_RCProtocol', 'AP_Radio', @@ -249,11 +252,8 @@ def ap_get_all_libraries(bld): def ap_common_vehicle_libraries(bld): libraries = COMMON_VEHICLE_DEPENDENT_LIBRARIES - if bld.env.DEST_BINFMT == 'pe': - libraries += [ - 'AC_Fence', - 'AC_AttitudeControl', - ] + if bld.env.with_can or bld.env.HAL_NUM_CAN_IFACES: + libraries.extend(COMMON_VEHICLE_DEPENDENT_CAN_LIBRARIES) return libraries