From c36b57acba227193fa470a1cf16174484c7d79b2 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 23 Feb 2024 19:29:09 +1100 Subject: [PATCH] AP_Compass: exclude cpp files if not AP_COMPASS_ENABLED --- libraries/AP_Compass/AP_Compass.cpp | 6 ++++++ libraries/AP_Compass/AP_Compass_Backend.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/libraries/AP_Compass/AP_Compass.cpp b/libraries/AP_Compass/AP_Compass.cpp index 45eccb97e7..ad7397d061 100644 --- a/libraries/AP_Compass/AP_Compass.cpp +++ b/libraries/AP_Compass/AP_Compass.cpp @@ -1,3 +1,7 @@ +#include "AP_Compass_config.h" + +#if AP_COMPASS_ENABLED + #include #if CONFIG_HAL_BOARD == HAL_BOARD_LINUX #include @@ -2236,3 +2240,5 @@ Compass &compass() } } + +#endif // AP_COMPASS_ENABLED diff --git a/libraries/AP_Compass/AP_Compass_Backend.cpp b/libraries/AP_Compass/AP_Compass_Backend.cpp index c0a7bf973e..7d430c3193 100644 --- a/libraries/AP_Compass/AP_Compass_Backend.cpp +++ b/libraries/AP_Compass/AP_Compass_Backend.cpp @@ -1,3 +1,7 @@ +#include "AP_Compass_config.h" + +#if AP_COMPASS_ENABLED + #include #include "AP_Compass.h" @@ -294,3 +298,5 @@ enum Rotation AP_Compass_Backend::get_board_orientation(void) const { return _compass._board_orientation; } + +#endif // AP_COMPASS_ENABLED