diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp
index c834d51de1..5b1bd0d2f9 100644
--- a/libraries/AP_Arming/AP_Arming.cpp
+++ b/libraries/AP_Arming/AP_Arming.cpp
@@ -13,6 +13,10 @@
along with this program. If not, see .
*/
+#include "AP_Arming_config.h"
+
+#if AP_ARMING_ENABLED
+
#include "AP_Arming.h"
#include
#include
@@ -2042,3 +2046,5 @@ AP_Arming &arming()
};
#pragma GCC diagnostic pop
+
+#endif // AP_ARMING_ENABLED