From e20d96ea4eab7fc931cf8c82c1a6163b8ef257d8 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 7 Dec 2019 21:39:58 -0800 Subject: [PATCH] Use __has_include for WPILib.h (#2164) Now that commands and cameraserver libraries are no longer direct dependencies, it's necessary to check for their presence. --- wpilibc/src/main/native/include/frc/WPILib.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wpilibc/src/main/native/include/frc/WPILib.h b/wpilibc/src/main/native/include/frc/WPILib.h index d9445002b3..9d62514e18 100644 --- a/wpilibc/src/main/native/include/frc/WPILib.h +++ b/wpilibc/src/main/native/include/frc/WPILib.h @@ -16,8 +16,10 @@ // clang-format on +#if __has_include() #include #include +#endif #include "frc/ADXL345_I2C.h" #include "frc/ADXL345_SPI.h" @@ -82,6 +84,7 @@ #include "frc/VictorSP.h" #include "frc/WPIErrors.h" #include "frc/XboxController.h" +#if __has_include("frc/buttons/InternalButton.h") #include "frc/buttons/InternalButton.h" #include "frc/buttons/JoystickButton.h" #include "frc/buttons/NetworkButton.h" @@ -95,6 +98,7 @@ #include "frc/commands/WaitCommand.h" #include "frc/commands/WaitForChildren.h" #include "frc/commands/WaitUntilCommand.h" +#endif #include "frc/drive/DifferentialDrive.h" #include "frc/drive/KilloughDrive.h" #include "frc/drive/MecanumDrive.h"