[build] Make Protobuf optional in CMake build (#7061)

This commit is contained in:
Tyler Veness
2024-09-12 23:44:19 -07:00
committed by GitHub
parent b9409a4bcf
commit d44b651558
77 changed files with 168 additions and 73 deletions

View File

@@ -235,5 +235,7 @@ class WPILIB_DLLEXPORT ArmFeedforward {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/controller/proto/ArmFeedforwardProto.h"
#endif
#include "frc/controller/struct/ArmFeedforwardStruct.h"

View File

@@ -87,5 +87,7 @@ class WPILIB_DLLEXPORT DifferentialDriveFeedforward {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/controller/proto/DifferentialDriveFeedforwardProto.h"
#endif
#include "frc/controller/struct/DifferentialDriveFeedforwardStruct.h"

View File

@@ -21,5 +21,7 @@ struct DifferentialDriveWheelVoltages {
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/controller/proto/DifferentialDriveWheelVoltagesProto.h"
#endif
#include "frc/controller/struct/DifferentialDriveWheelVoltagesStruct.h"

View File

@@ -225,5 +225,7 @@ class ElevatorFeedforward {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/controller/proto/ElevatorFeedforwardProto.h"
#endif
#include "frc/controller/struct/ElevatorFeedforwardStruct.h"

View File

@@ -208,5 +208,7 @@ class WPILIB_DLLEXPORT Ellipse2d {
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Ellipse2dProto.h"
#endif
#include "frc/geometry/struct/Ellipse2dStruct.h"

View File

@@ -213,6 +213,8 @@ void from_json(const wpi::json& json, Pose2d& pose);
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Pose2dProto.h"
#endif
#include "frc/geometry/struct/Pose2dStruct.h"
#include "frc/geometry/Pose2d.inc"

View File

@@ -215,5 +215,7 @@ void from_json(const wpi::json& json, Pose3d& pose);
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Pose3dProto.h"
#endif
#include "frc/geometry/struct/Pose3dStruct.h"

View File

@@ -191,5 +191,7 @@ void from_json(const wpi::json& json, Quaternion& quaternion);
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/QuaternionProto.h"
#endif
#include "frc/geometry/struct/QuaternionStruct.h"

View File

@@ -206,5 +206,7 @@ class WPILIB_DLLEXPORT Rectangle2d {
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Rectangle2dProto.h"
#endif
#include "frc/geometry/struct/Rectangle2dStruct.h"

View File

@@ -169,6 +169,8 @@ void from_json(const wpi::json& json, Rotation2d& rotation);
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Rotation2dProto.h"
#endif
#include "frc/geometry/struct/Rotation2dStruct.h"
#include "frc/geometry/Rotation2d.inc"

View File

@@ -195,5 +195,7 @@ void from_json(const wpi::json& json, Rotation3d& rotation);
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Rotation3dProto.h"
#endif
#include "frc/geometry/struct/Rotation3dStruct.h"

View File

@@ -124,6 +124,8 @@ class WPILIB_DLLEXPORT Transform2d {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Transform2dProto.h"
#endif
#include "frc/geometry/struct/Transform2dStruct.h"
#include "frc/geometry/Transform2d.inc"

View File

@@ -130,5 +130,7 @@ class WPILIB_DLLEXPORT Transform3d {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Transform3dProto.h"
#endif
#include "frc/geometry/struct/Transform3dStruct.h"

View File

@@ -232,6 +232,8 @@ void from_json(const wpi::json& json, Translation2d& state);
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Translation2dProto.h"
#endif
#include "frc/geometry/struct/Translation2dStruct.h"
#include "frc/geometry/Translation2d.inc"

View File

@@ -199,6 +199,8 @@ void from_json(const wpi::json& json, Translation3d& state);
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Translation3dProto.h"
#endif
#include "frc/geometry/struct/Translation3dStruct.h"
#include "frc/geometry/Translation3d.inc"

View File

@@ -58,5 +58,7 @@ struct WPILIB_DLLEXPORT Twist2d {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Twist2dProto.h"
#endif
#include "frc/geometry/struct/Twist2dStruct.h"

View File

@@ -78,5 +78,7 @@ struct WPILIB_DLLEXPORT Twist3d {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/geometry/proto/Twist3dProto.h"
#endif
#include "frc/geometry/struct/Twist3dStruct.h"

View File

@@ -279,5 +279,7 @@ struct WPILIB_DLLEXPORT ChassisSpeeds {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/kinematics/proto/ChassisSpeedsProto.h"
#endif
#include "frc/kinematics/struct/ChassisSpeedsStruct.h"

View File

@@ -99,5 +99,7 @@ class WPILIB_DLLEXPORT DifferentialDriveKinematics
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/kinematics/proto/DifferentialDriveKinematicsProto.h"
#endif
#include "frc/kinematics/struct/DifferentialDriveKinematicsStruct.h"

View File

@@ -50,5 +50,7 @@ struct WPILIB_DLLEXPORT DifferentialDriveWheelPositions {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/kinematics/proto/DifferentialDriveWheelPositionsProto.h"
#endif
#include "frc/kinematics/struct/DifferentialDriveWheelPositionsStruct.h"

View File

@@ -113,5 +113,7 @@ struct WPILIB_DLLEXPORT DifferentialDriveWheelSpeeds {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/kinematics/proto/DifferentialDriveWheelSpeedsProto.h"
#endif
#include "frc/kinematics/struct/DifferentialDriveWheelSpeedsStruct.h"

View File

@@ -200,5 +200,7 @@ class WPILIB_DLLEXPORT MecanumDriveKinematics
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/kinematics/proto/MecanumDriveKinematicsProto.h"
#endif
#include "frc/kinematics/struct/MecanumDriveKinematicsStruct.h"

View File

@@ -61,5 +61,7 @@ struct WPILIB_DLLEXPORT MecanumDriveWheelPositions {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/kinematics/proto/MecanumDriveWheelPositionsProto.h"
#endif
#include "frc/kinematics/struct/MecanumDriveWheelPositionsStruct.h"

View File

@@ -121,5 +121,7 @@ struct WPILIB_DLLEXPORT MecanumDriveWheelSpeeds {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/kinematics/proto/MecanumDriveWheelSpeedsProto.h"
#endif
#include "frc/kinematics/struct/MecanumDriveWheelSpeedsStruct.h"

View File

@@ -43,5 +43,7 @@ struct WPILIB_DLLEXPORT SwerveModulePosition {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/kinematics/proto/SwerveModulePositionProto.h"
#endif
#include "frc/kinematics/struct/SwerveModulePositionStruct.h"

View File

@@ -48,5 +48,7 @@ struct WPILIB_DLLEXPORT SwerveModuleState {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/kinematics/proto/SwerveModuleStateProto.h"
#endif
#include "frc/kinematics/struct/SwerveModuleStateStruct.h"

View File

@@ -115,5 +115,7 @@ class WPILIB_DLLEXPORT CubicHermiteSpline : public Spline<3> {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/spline/proto/CubicHermiteSplineProto.h"
#endif
#include "frc/spline/struct/CubicHermiteSplineStruct.h"

View File

@@ -125,5 +125,7 @@ class WPILIB_DLLEXPORT QuinticHermiteSpline : public Spline<5> {
};
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/spline/proto/QuinticHermiteSplineProto.h"
#endif
#include "frc/spline/struct/QuinticHermiteSplineStruct.h"

View File

@@ -6,7 +6,6 @@
#include <wpi/protobuf/Protobuf.h>
#include "frc/proto/MatrixProto.h"
#include "frc/system/LinearSystem.h"
template <int States, int Inputs, int Outputs>

View File

@@ -9,6 +9,7 @@
#include <fmt/format.h>
#include <wpi/ProtoHelper.h>
#include "frc/proto/MatrixProto.h"
#include "frc/system/proto/LinearSystemProto.h"
#include "system.pb.h"

View File

@@ -146,5 +146,7 @@ void from_json(const wpi::json& json, Trajectory::State& state);
} // namespace frc
#ifndef NO_PROTOBUF
#include "frc/trajectory/proto/TrajectoryProto.h"
#include "frc/trajectory/proto/TrajectoryStateProto.h"
#endif