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.
This commit is contained in:
Peter Johnson
2019-12-07 21:39:58 -08:00
committed by GitHub
parent a76d006a07
commit e20d96ea4e

View File

@@ -16,8 +16,10 @@
// clang-format on
#if __has_include(<cameraserver/CameraServer.h>)
#include <cameraserver/CameraServer.h>
#include <vision/VisionRunner.h>
#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"