diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bcc181ea8..6c4b56fd2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,7 @@ option(WITH_EXAMPLES "Build examples" OFF) option(WITH_TESTS "Build unit tests (requires internet connection)" ON) option(WITH_GUI "Build GUI items" ON) option(WITH_SIMULATION_MODULES "Build simulation modules" ON) +option(WITH_PROTOBUF "Build protobuf support" ON) # Options for using a package manager (e.g., vcpkg) for certain dependencies. option(USE_SYSTEM_FMTLIB "Use system fmtlib" OFF) @@ -131,9 +132,11 @@ endif() find_package(LIBSSH 0.7.1) set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) -set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "" FORCE) -find_package(Protobuf REQUIRED) -find_program(PROTOC_COMPILER protoc REQUIRED) +if(WITH_PROTOBUF) + set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "" FORCE) + find_package(Protobuf REQUIRED) + find_program(PROTOC_COMPILER protoc REQUIRED) +endif() set(CMAKE_FIND_PACKAGE_PREFER_CONFIG OFF) get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) diff --git a/cmake/modules/AddTest.cmake b/cmake/modules/AddTest.cmake index 224cffa3b2..b916f6f2cc 100644 --- a/cmake/modules/AddTest.cmake +++ b/cmake/modules/AddTest.cmake @@ -2,6 +2,9 @@ include(CompileWarnings) macro(wpilib_add_test name srcdir) file(GLOB_RECURSE test_src ${srcdir}/*.cpp) + if(NOT WITH_PROTOBUF) + list(FILTER test_src EXCLUDE REGEX "/proto/") + endif() add_executable(${name}_test ${test_src}) set_property(TARGET ${name}_test PROPERTY FOLDER "tests") wpilib_target_warnings(${name}_test) diff --git a/glass/src/lib/native/cpp/support/DataLogReaderThread.cpp b/glass/src/lib/native/cpp/support/DataLogReaderThread.cpp index b9fdb44563..bdbfec77ab 100644 --- a/glass/src/lib/native/cpp/support/DataLogReaderThread.cpp +++ b/glass/src/lib/native/cpp/support/DataLogReaderThread.cpp @@ -109,11 +109,13 @@ void DataLogReaderThread::ReadMain() { schema, err); } } else if (auto filename = wpi::remove_prefix(name, "/.schema/proto:")) { +#ifndef NO_PROTOBUF // protobuf descriptor handling if (!m_protoDb.Add(*filename, data)) { wpi::print("could not decode protobuf '{}' filename '{}'\n", name, *filename); } +#endif } } diff --git a/glass/src/lib/native/include/glass/support/DataLogReaderThread.h b/glass/src/lib/native/include/glass/support/DataLogReaderThread.h index bcbc9623ef..2cfb89e39b 100644 --- a/glass/src/lib/native/include/glass/support/DataLogReaderThread.h +++ b/glass/src/lib/native/include/glass/support/DataLogReaderThread.h @@ -17,9 +17,12 @@ #include #include #include -#include #include +#ifndef NO_PROTOBUF +#include +#endif + namespace glass { class DataLogReaderRange { @@ -75,7 +78,9 @@ class DataLogReaderThread { } wpi::StructDescriptorDatabase& GetStructDatabase() { return m_structDb; } +#ifndef NO_PROTOBUF wpi::ProtobufMessageDatabase& GetProtobufDatabase() { return m_protoDb; } +#endif const wpi::log::DataLogReader& GetReader() const { return m_reader; } @@ -94,7 +99,9 @@ class DataLogReaderThread { std::map> m_entriesByName; wpi::DenseMap m_entriesById; wpi::StructDescriptorDatabase m_structDb; +#ifndef NO_PROTOBUF wpi::ProtobufMessageDatabase m_protoDb; +#endif std::thread m_thread; }; diff --git a/glass/src/libnt/native/cpp/NetworkTables.cpp b/glass/src/libnt/native/cpp/NetworkTables.cpp index 0f249ca340..5430a50d58 100644 --- a/glass/src/libnt/native/cpp/NetworkTables.cpp +++ b/glass/src/libnt/native/cpp/NetworkTables.cpp @@ -14,8 +14,6 @@ #include #include -#include -#include #include #include #include @@ -31,6 +29,11 @@ #include #include +#ifndef NO_PROTOBUF +#include +#include +#endif + #include "glass/Context.h" #include "glass/DataSource.h" #include "glass/Storage.h" @@ -346,6 +349,7 @@ static void UpdateStructValueSource(NetworkTablesModel& model, } } +#ifndef NO_PROTOBUF static void UpdateProtobufValueSource(NetworkTablesModel& model, NetworkTablesModel::ValueSource* out, const google::protobuf::Message& msg, @@ -534,6 +538,7 @@ static void UpdateProtobufValueSource(NetworkTablesModel& model, } } } +#endif static void UpdateJsonValueSource(NetworkTablesModel& model, NetworkTablesModel::ValueSource* out, @@ -764,6 +769,7 @@ void NetworkTablesModel::ValueSource::UpdateFromValue( valueChildren.clear(); } } else if (auto filename = wpi::remove_prefix(typeStr, "proto:")) { +#ifndef NO_PROTOBUF auto msg = model.m_protoDb.Find(*filename); if (msg) { msg->Clear(); @@ -777,6 +783,9 @@ void NetworkTablesModel::ValueSource::UpdateFromValue( } else { valueChildren.clear(); } +#else + valueChildren.clear(); +#endif } else { valueChildren.clear(); } @@ -902,6 +911,7 @@ void NetworkTablesModel::Update() { wpi::remove_prefix(entry->info.name, "/.schema/proto:"); entry->value.IsRaw() && filename && entry->info.type_str == "proto:FileDescriptorProto") { +#ifndef NO_PROTOBUF // protobuf descriptor handling if (!m_protoDb.Add(*filename, entry->value.GetRaw())) { wpi::print("could not decode protobuf '{}' filename '{}'\n", @@ -918,6 +928,7 @@ void NetworkTablesModel::Update() { } } } +#endif } } } diff --git a/glass/src/libnt/native/include/glass/networktables/NetworkTables.h b/glass/src/libnt/native/include/glass/networktables/NetworkTables.h index 8416cf9dfd..bca5a41192 100644 --- a/glass/src/libnt/native/include/glass/networktables/NetworkTables.h +++ b/glass/src/libnt/native/include/glass/networktables/NetworkTables.h @@ -18,9 +18,12 @@ #include #include #include -#include #include +#ifndef NO_PROTOBUF +#include +#endif + #include "glass/Model.h" #include "glass/View.h" @@ -168,7 +171,9 @@ class NetworkTablesModel : public Model { Entry* AddEntry(NT_Topic topic); wpi::StructDescriptorDatabase& GetStructDatabase() { return m_structDb; } +#ifndef NO_PROTOBUF wpi::ProtobufMessageDatabase& GetProtobufDatabase() { return m_protoDb; } +#endif private: void RebuildTree(); @@ -191,7 +196,9 @@ class NetworkTablesModel : public Model { Client m_server; wpi::StructDescriptorDatabase m_structDb; +#ifndef NO_PROTOBUF wpi::ProtobufMessageDatabase m_protoDb; +#endif }; using NetworkTablesFlags = int; diff --git a/wpimath/.styleguide b/wpimath/.styleguide index 00437ce869..3e67f48eec 100644 --- a/wpimath/.styleguide +++ b/wpimath/.styleguide @@ -38,6 +38,7 @@ includeOtherLibs { ^Eigen/ ^fmt/ ^gcem/ + ^google/ ^gtest/ ^unsupported/ ^wpi/ diff --git a/wpimath/CMakeLists.txt b/wpimath/CMakeLists.txt index 52624ed9d5..2b75f8d14b 100644 --- a/wpimath/CMakeLists.txt +++ b/wpimath/CMakeLists.txt @@ -6,9 +6,11 @@ include(AddTest) include(DownloadAndCheck) include(WpiProtobuf) -# workaround for makefiles - for some reason parent directories aren't created. -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/protobuf") -file(GLOB wpimath_proto_src src/main/proto/*.proto) +if(WITH_PROTOBUF) + # workaround for makefiles - for some reason parent directories aren't created. + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/protobuf") + file(GLOB wpimath_proto_src src/main/proto/*.proto) +endif() file( GLOB wpimath_jni_src @@ -120,21 +122,28 @@ file( src/main/native/thirdparty/sleipnir/src/*.cpp ) list(REMOVE_ITEM wpimath_native_src ${wpimath_jni_src}) +if(NOT WITH_PROTOBUF) + list(FILTER wpimath_native_src EXCLUDE REGEX "/proto/") +endif() set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS FALSE) -add_library(protobuf OBJECT) -target_link_libraries(protobuf wpiutil) +if(WITH_PROTOBUF) + add_library(protobuf OBJECT) + target_link_libraries(protobuf wpiutil) -add_library(wpimath ${wpimath_native_src} $) + add_library(wpimath ${wpimath_native_src} $) -wpi_protobuf_generate( - TARGET - protobuf - PROTOS ${wpimath_proto_src} - PLUGIN ${PROTOC_WPILIB_PLUGIN} - PROTOC_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf" -) + wpi_protobuf_generate( + TARGET + protobuf + PROTOS ${wpimath_proto_src} + PLUGIN ${PROTOC_WPILIB_PLUGIN} + PROTOC_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf" + ) +else() + add_library(wpimath ${wpimath_native_src}) +endif() if(MSVC) get_property(IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) @@ -164,12 +173,18 @@ set_target_properties(wpimath PROPERTIES DEBUG_POSTFIX "d") set_property(TARGET wpimath PROPERTY FOLDER "libraries") target_compile_definitions(wpimath PRIVATE WPILIB_EXPORTS SLEIPNIR_EXPORTS) -target_compile_features(protobuf PUBLIC cxx_std_20) target_compile_features(wpimath PUBLIC cxx_std_20) if(MSVC) target_compile_options(wpimath PUBLIC /utf-8 /bigobj) - target_compile_options(protobuf PUBLIC /utf-8 /bigobj) endif() + +if(WITH_PROTOBUF) + target_compile_features(protobuf PUBLIC cxx_std_20) + if(MSVC) + target_compile_options(protobuf PUBLIC /utf-8 /bigobj) + endif() +endif() + wpilib_target_warnings(wpimath) target_link_libraries(wpimath wpiutil) diff --git a/wpimath/src/main/native/cpp/geometry/Ellipse2d.cpp b/wpimath/src/main/native/cpp/geometry/Ellipse2d.cpp index 4288b8b44b..6f8afa636a 100644 --- a/wpimath/src/main/native/cpp/geometry/Ellipse2d.cpp +++ b/wpimath/src/main/native/cpp/geometry/Ellipse2d.cpp @@ -6,8 +6,6 @@ #include -#include "geometry2d.pb.h" - using namespace frc; units::meter_t Ellipse2d::Distance(const Translation2d& point) const { diff --git a/wpimath/src/main/native/cpp/geometry/Pose3d.cpp b/wpimath/src/main/native/cpp/geometry/Pose3d.cpp index bd7ab8681e..be29062596 100644 --- a/wpimath/src/main/native/cpp/geometry/Pose3d.cpp +++ b/wpimath/src/main/native/cpp/geometry/Pose3d.cpp @@ -9,8 +9,6 @@ #include #include -#include "geometry3d.pb.h" - using namespace frc; namespace { diff --git a/wpimath/src/main/native/cpp/geometry/Rectangle2d.cpp b/wpimath/src/main/native/cpp/geometry/Rectangle2d.cpp deleted file mode 100644 index 0d1f77bc64..0000000000 --- a/wpimath/src/main/native/cpp/geometry/Rectangle2d.cpp +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include "frc/geometry/Rectangle2d.h" - -#include "geometry2d.pb.h" diff --git a/wpimath/src/main/native/cpp/geometry/Rotation2d.cpp b/wpimath/src/main/native/cpp/geometry/Rotation2d.cpp index 69193028f7..921e1f81a0 100644 --- a/wpimath/src/main/native/cpp/geometry/Rotation2d.cpp +++ b/wpimath/src/main/native/cpp/geometry/Rotation2d.cpp @@ -8,7 +8,6 @@ #include -#include "geometry2d.pb.h" #include "units/math.h" using namespace frc; diff --git a/wpimath/src/main/native/cpp/geometry/Rotation3d.cpp b/wpimath/src/main/native/cpp/geometry/Rotation3d.cpp index 072d023cb2..b4dce35a5d 100644 --- a/wpimath/src/main/native/cpp/geometry/Rotation3d.cpp +++ b/wpimath/src/main/native/cpp/geometry/Rotation3d.cpp @@ -13,7 +13,6 @@ #include #include "frc/fmt/Eigen.h" -#include "geometry3d.pb.h" #include "units/math.h" #include "wpimath/MathShared.h" diff --git a/wpimath/src/main/native/cpp/geometry/Transform2d.cpp b/wpimath/src/main/native/cpp/geometry/Transform2d.cpp index 157359bfbc..25b05907ed 100644 --- a/wpimath/src/main/native/cpp/geometry/Transform2d.cpp +++ b/wpimath/src/main/native/cpp/geometry/Transform2d.cpp @@ -5,7 +5,6 @@ #include "frc/geometry/Transform2d.h" #include "frc/geometry/Pose2d.h" -#include "geometry2d.pb.h" using namespace frc; diff --git a/wpimath/src/main/native/cpp/geometry/Translation2d.cpp b/wpimath/src/main/native/cpp/geometry/Translation2d.cpp index c0a349e7aa..72365a100b 100644 --- a/wpimath/src/main/native/cpp/geometry/Translation2d.cpp +++ b/wpimath/src/main/native/cpp/geometry/Translation2d.cpp @@ -6,7 +6,6 @@ #include -#include "geometry2d.pb.h" #include "units/math.h" using namespace frc; diff --git a/wpimath/src/main/native/cpp/geometry/Translation3d.cpp b/wpimath/src/main/native/cpp/geometry/Translation3d.cpp index c3b8cb4b77..69757f3080 100644 --- a/wpimath/src/main/native/cpp/geometry/Translation3d.cpp +++ b/wpimath/src/main/native/cpp/geometry/Translation3d.cpp @@ -6,7 +6,6 @@ #include -#include "geometry3d.pb.h" #include "units/length.h" #include "units/math.h" diff --git a/wpimath/src/main/native/include/frc/controller/ArmFeedforward.h b/wpimath/src/main/native/include/frc/controller/ArmFeedforward.h index ab5ba920fc..f5647324ac 100644 --- a/wpimath/src/main/native/include/frc/controller/ArmFeedforward.h +++ b/wpimath/src/main/native/include/frc/controller/ArmFeedforward.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/controller/DifferentialDriveFeedforward.h b/wpimath/src/main/native/include/frc/controller/DifferentialDriveFeedforward.h index be7e5b4fac..ff4ed61015 100644 --- a/wpimath/src/main/native/include/frc/controller/DifferentialDriveFeedforward.h +++ b/wpimath/src/main/native/include/frc/controller/DifferentialDriveFeedforward.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/controller/DifferentialDriveWheelVoltages.h b/wpimath/src/main/native/include/frc/controller/DifferentialDriveWheelVoltages.h index 424cd2d1b3..6d9b6dd056 100644 --- a/wpimath/src/main/native/include/frc/controller/DifferentialDriveWheelVoltages.h +++ b/wpimath/src/main/native/include/frc/controller/DifferentialDriveWheelVoltages.h @@ -21,5 +21,7 @@ struct DifferentialDriveWheelVoltages { } // namespace frc +#ifndef NO_PROTOBUF #include "frc/controller/proto/DifferentialDriveWheelVoltagesProto.h" +#endif #include "frc/controller/struct/DifferentialDriveWheelVoltagesStruct.h" diff --git a/wpimath/src/main/native/include/frc/controller/ElevatorFeedforward.h b/wpimath/src/main/native/include/frc/controller/ElevatorFeedforward.h index 2180ab0b7b..6c7f927979 100644 --- a/wpimath/src/main/native/include/frc/controller/ElevatorFeedforward.h +++ b/wpimath/src/main/native/include/frc/controller/ElevatorFeedforward.h @@ -225,5 +225,7 @@ class ElevatorFeedforward { }; } // namespace frc +#ifndef NO_PROTOBUF #include "frc/controller/proto/ElevatorFeedforwardProto.h" +#endif #include "frc/controller/struct/ElevatorFeedforwardStruct.h" diff --git a/wpimath/src/main/native/include/frc/geometry/Ellipse2d.h b/wpimath/src/main/native/include/frc/geometry/Ellipse2d.h index f57303d1e8..e1731105eb 100644 --- a/wpimath/src/main/native/include/frc/geometry/Ellipse2d.h +++ b/wpimath/src/main/native/include/frc/geometry/Ellipse2d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Pose2d.h b/wpimath/src/main/native/include/frc/geometry/Pose2d.h index 65a146c3dd..7f8f47cafe 100644 --- a/wpimath/src/main/native/include/frc/geometry/Pose2d.h +++ b/wpimath/src/main/native/include/frc/geometry/Pose2d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Pose3d.h b/wpimath/src/main/native/include/frc/geometry/Pose3d.h index 526dced399..f077a61010 100644 --- a/wpimath/src/main/native/include/frc/geometry/Pose3d.h +++ b/wpimath/src/main/native/include/frc/geometry/Pose3d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Quaternion.h b/wpimath/src/main/native/include/frc/geometry/Quaternion.h index 4fe694cf25..4a4927632b 100644 --- a/wpimath/src/main/native/include/frc/geometry/Quaternion.h +++ b/wpimath/src/main/native/include/frc/geometry/Quaternion.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Rectangle2d.h b/wpimath/src/main/native/include/frc/geometry/Rectangle2d.h index f03ca98c44..22ee80f22e 100644 --- a/wpimath/src/main/native/include/frc/geometry/Rectangle2d.h +++ b/wpimath/src/main/native/include/frc/geometry/Rectangle2d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Rotation2d.h b/wpimath/src/main/native/include/frc/geometry/Rotation2d.h index 6e9cd8e2a8..4e5357e9bb 100644 --- a/wpimath/src/main/native/include/frc/geometry/Rotation2d.h +++ b/wpimath/src/main/native/include/frc/geometry/Rotation2d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Rotation3d.h b/wpimath/src/main/native/include/frc/geometry/Rotation3d.h index bc01f2b8ee..632f2ba29f 100644 --- a/wpimath/src/main/native/include/frc/geometry/Rotation3d.h +++ b/wpimath/src/main/native/include/frc/geometry/Rotation3d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Transform2d.h b/wpimath/src/main/native/include/frc/geometry/Transform2d.h index dccc0e1eee..af984eadb4 100644 --- a/wpimath/src/main/native/include/frc/geometry/Transform2d.h +++ b/wpimath/src/main/native/include/frc/geometry/Transform2d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Transform3d.h b/wpimath/src/main/native/include/frc/geometry/Transform3d.h index 94ecfe37ed..9f42d18581 100644 --- a/wpimath/src/main/native/include/frc/geometry/Transform3d.h +++ b/wpimath/src/main/native/include/frc/geometry/Transform3d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Translation2d.h b/wpimath/src/main/native/include/frc/geometry/Translation2d.h index 674bd9efe1..5c91e9d8fd 100644 --- a/wpimath/src/main/native/include/frc/geometry/Translation2d.h +++ b/wpimath/src/main/native/include/frc/geometry/Translation2d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Translation3d.h b/wpimath/src/main/native/include/frc/geometry/Translation3d.h index b83b661fd9..75e5bf3dcf 100644 --- a/wpimath/src/main/native/include/frc/geometry/Translation3d.h +++ b/wpimath/src/main/native/include/frc/geometry/Translation3d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Twist2d.h b/wpimath/src/main/native/include/frc/geometry/Twist2d.h index d13cc4ec80..4d61501d99 100644 --- a/wpimath/src/main/native/include/frc/geometry/Twist2d.h +++ b/wpimath/src/main/native/include/frc/geometry/Twist2d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/geometry/Twist3d.h b/wpimath/src/main/native/include/frc/geometry/Twist3d.h index 3262367dc0..2ce4a964e3 100644 --- a/wpimath/src/main/native/include/frc/geometry/Twist3d.h +++ b/wpimath/src/main/native/include/frc/geometry/Twist3d.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/kinematics/ChassisSpeeds.h b/wpimath/src/main/native/include/frc/kinematics/ChassisSpeeds.h index 299e18a28b..4e8302b154 100644 --- a/wpimath/src/main/native/include/frc/kinematics/ChassisSpeeds.h +++ b/wpimath/src/main/native/include/frc/kinematics/ChassisSpeeds.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveKinematics.h b/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveKinematics.h index fbbb519182..11c04be7a4 100644 --- a/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveKinematics.h +++ b/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveKinematics.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveWheelPositions.h b/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveWheelPositions.h index f22d6874f6..60575cf8c7 100644 --- a/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveWheelPositions.h +++ b/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveWheelPositions.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveWheelSpeeds.h b/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveWheelSpeeds.h index 676b8ad59c..98db2b861a 100644 --- a/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveWheelSpeeds.h +++ b/wpimath/src/main/native/include/frc/kinematics/DifferentialDriveWheelSpeeds.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/kinematics/MecanumDriveKinematics.h b/wpimath/src/main/native/include/frc/kinematics/MecanumDriveKinematics.h index 218908fd31..e23e7e3adb 100644 --- a/wpimath/src/main/native/include/frc/kinematics/MecanumDriveKinematics.h +++ b/wpimath/src/main/native/include/frc/kinematics/MecanumDriveKinematics.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/kinematics/MecanumDriveWheelPositions.h b/wpimath/src/main/native/include/frc/kinematics/MecanumDriveWheelPositions.h index 77d79192b9..8a9943bcc8 100644 --- a/wpimath/src/main/native/include/frc/kinematics/MecanumDriveWheelPositions.h +++ b/wpimath/src/main/native/include/frc/kinematics/MecanumDriveWheelPositions.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/kinematics/MecanumDriveWheelSpeeds.h b/wpimath/src/main/native/include/frc/kinematics/MecanumDriveWheelSpeeds.h index 5df198c801..10f971e988 100644 --- a/wpimath/src/main/native/include/frc/kinematics/MecanumDriveWheelSpeeds.h +++ b/wpimath/src/main/native/include/frc/kinematics/MecanumDriveWheelSpeeds.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/kinematics/SwerveModulePosition.h b/wpimath/src/main/native/include/frc/kinematics/SwerveModulePosition.h index 576bfcf00f..4cbe97fcb5 100644 --- a/wpimath/src/main/native/include/frc/kinematics/SwerveModulePosition.h +++ b/wpimath/src/main/native/include/frc/kinematics/SwerveModulePosition.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/kinematics/SwerveModuleState.h b/wpimath/src/main/native/include/frc/kinematics/SwerveModuleState.h index 3060d35fc2..adfeebbbbf 100644 --- a/wpimath/src/main/native/include/frc/kinematics/SwerveModuleState.h +++ b/wpimath/src/main/native/include/frc/kinematics/SwerveModuleState.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/spline/CubicHermiteSpline.h b/wpimath/src/main/native/include/frc/spline/CubicHermiteSpline.h index 420566b3d5..2580b1be7e 100644 --- a/wpimath/src/main/native/include/frc/spline/CubicHermiteSpline.h +++ b/wpimath/src/main/native/include/frc/spline/CubicHermiteSpline.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/spline/QuinticHermiteSpline.h b/wpimath/src/main/native/include/frc/spline/QuinticHermiteSpline.h index fb0d227e29..1c592eb2fa 100644 --- a/wpimath/src/main/native/include/frc/spline/QuinticHermiteSpline.h +++ b/wpimath/src/main/native/include/frc/spline/QuinticHermiteSpline.h @@ -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" diff --git a/wpimath/src/main/native/include/frc/system/proto/LinearSystemProto.h b/wpimath/src/main/native/include/frc/system/proto/LinearSystemProto.h index 6d5452fc72..f47f63e67c 100644 --- a/wpimath/src/main/native/include/frc/system/proto/LinearSystemProto.h +++ b/wpimath/src/main/native/include/frc/system/proto/LinearSystemProto.h @@ -6,7 +6,6 @@ #include -#include "frc/proto/MatrixProto.h" #include "frc/system/LinearSystem.h" template diff --git a/wpimath/src/main/native/include/frc/system/proto/LinearSystemProto.inc b/wpimath/src/main/native/include/frc/system/proto/LinearSystemProto.inc index f41d8e91ec..5151f4e17b 100644 --- a/wpimath/src/main/native/include/frc/system/proto/LinearSystemProto.inc +++ b/wpimath/src/main/native/include/frc/system/proto/LinearSystemProto.inc @@ -9,6 +9,7 @@ #include #include +#include "frc/proto/MatrixProto.h" #include "frc/system/proto/LinearSystemProto.h" #include "system.pb.h" diff --git a/wpimath/src/main/native/include/frc/trajectory/Trajectory.h b/wpimath/src/main/native/include/frc/trajectory/Trajectory.h index 753bf9e2d1..ba29617ee1 100644 --- a/wpimath/src/main/native/include/frc/trajectory/Trajectory.h +++ b/wpimath/src/main/native/include/frc/trajectory/Trajectory.h @@ -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 diff --git a/wpimath/src/test/native/cpp/ProtoTestBase.h b/wpimath/src/test/native/cpp/ProtoTestBase.h index 88e149e3e0..5a5affd812 100644 --- a/wpimath/src/test/native/cpp/ProtoTestBase.h +++ b/wpimath/src/test/native/cpp/ProtoTestBase.h @@ -4,15 +4,10 @@ #pragma once +#include #include #include -#include "controller.pb.h" -#include "kinematics.pb.h" -#include "spline.pb.h" -#include "system.pb.h" -#include "wpimath.pb.h" - template class ProtoTest : public testing::Test {}; diff --git a/wpimath/src/test/native/cpp/controller/proto/ArmFeedforwardProtoTest.cpp b/wpimath/src/test/native/cpp/controller/proto/ArmFeedforwardProtoTest.cpp index 4df8566db2..6ad9579a74 100644 --- a/wpimath/src/test/native/cpp/controller/proto/ArmFeedforwardProtoTest.cpp +++ b/wpimath/src/test/native/cpp/controller/proto/ArmFeedforwardProtoTest.cpp @@ -2,9 +2,9 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include -#include "controller.pb.h" #include "frc/controller/ArmFeedforward.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProtoTest.cpp b/wpimath/src/test/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProtoTest.cpp index 1adad90fd7..466aa50f39 100644 --- a/wpimath/src/test/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProtoTest.cpp +++ b/wpimath/src/test/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProtoTest.cpp @@ -2,9 +2,9 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include -#include "controller.pb.h" #include "frc/controller/DifferentialDriveWheelVoltages.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/controller/proto/ElevatorFeedforwardProtoTest.cpp b/wpimath/src/test/native/cpp/controller/proto/ElevatorFeedforwardProtoTest.cpp index 5ec136f6aa..62d8bdb4c8 100644 --- a/wpimath/src/test/native/cpp/controller/proto/ElevatorFeedforwardProtoTest.cpp +++ b/wpimath/src/test/native/cpp/controller/proto/ElevatorFeedforwardProtoTest.cpp @@ -2,9 +2,9 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include -#include "controller.pb.h" #include "frc/controller/ElevatorFeedforward.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Ellipse2dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Ellipse2dProtoTest.cpp index 47819002b5..810d368e63 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Ellipse2dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Ellipse2dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Ellipse2d.h" -#include "geometry2d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Pose2dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Pose2dProtoTest.cpp index c6e9d49ec5..64067dde4b 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Pose2dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Pose2dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Pose2d.h" -#include "geometry2d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Pose3dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Pose3dProtoTest.cpp index d8847cab88..f685f9b8e1 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Pose3dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Pose3dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Pose3d.h" -#include "geometry3d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/QuaternionProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/QuaternionProtoTest.cpp index 92338df832..13c206e6aa 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/QuaternionProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/QuaternionProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Quaternion.h" -#include "geometry3d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Rectangle2dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Rectangle2dProtoTest.cpp index 4949c0bb14..04f2d774f2 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Rectangle2dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Rectangle2dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Rectangle2d.h" -#include "geometry2d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Rotation2dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Rotation2dProtoTest.cpp index 3ab9e1bb26..4a10988ab7 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Rotation2dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Rotation2dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Rotation2d.h" -#include "geometry2d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Rotation3dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Rotation3dProtoTest.cpp index a83b78c2a0..7850894b0a 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Rotation3dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Rotation3dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Rotation3d.h" -#include "geometry3d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Transform2dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Transform2dProtoTest.cpp index 4b975f3e14..6225426f32 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Transform2dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Transform2dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Transform2d.h" -#include "geometry2d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Transform3dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Transform3dProtoTest.cpp index 3a86421cfa..c5731eea0d 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Transform3dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Transform3dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Transform3d.h" -#include "geometry3d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Translation2dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Translation2dProtoTest.cpp index e6a895969d..37ec61b3b1 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Translation2dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Translation2dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Translation2d.h" -#include "geometry2d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Translation3dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Translation3dProtoTest.cpp index 3f6d59f9cf..732b1a62af 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Translation3dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Translation3dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Translation3d.h" -#include "geometry3d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Twist2dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Twist2dProtoTest.cpp index d9f4faeb21..305d3297d8 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Twist2dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Twist2dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Twist2d.h" -#include "geometry2d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/geometry/proto/Twist3dProtoTest.cpp b/wpimath/src/test/native/cpp/geometry/proto/Twist3dProtoTest.cpp index b4e7bf0730..9c454840a0 100644 --- a/wpimath/src/test/native/cpp/geometry/proto/Twist3dProtoTest.cpp +++ b/wpimath/src/test/native/cpp/geometry/proto/Twist3dProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/geometry/Twist3d.h" -#include "geometry3d.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/kinematics/proto/ChassisSpeedsProtoTest.cpp b/wpimath/src/test/native/cpp/kinematics/proto/ChassisSpeedsProtoTest.cpp index 375909a330..9d91a5b2ff 100644 --- a/wpimath/src/test/native/cpp/kinematics/proto/ChassisSpeedsProtoTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/proto/ChassisSpeedsProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/kinematics/ChassisSpeeds.h" -#include "kinematics.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/kinematics/proto/DifferentialDriveKinematicsProtoTest.cpp b/wpimath/src/test/native/cpp/kinematics/proto/DifferentialDriveKinematicsProtoTest.cpp index 4d57108833..47ed61fea6 100644 --- a/wpimath/src/test/native/cpp/kinematics/proto/DifferentialDriveKinematicsProtoTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/proto/DifferentialDriveKinematicsProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/kinematics/DifferentialDriveKinematics.h" -#include "kinematics.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/kinematics/proto/DifferentialDriveWheelSpeedsProtoTest.cpp b/wpimath/src/test/native/cpp/kinematics/proto/DifferentialDriveWheelSpeedsProtoTest.cpp index 83e317f206..35ac5aebce 100644 --- a/wpimath/src/test/native/cpp/kinematics/proto/DifferentialDriveWheelSpeedsProtoTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/proto/DifferentialDriveWheelSpeedsProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/kinematics/DifferentialDriveWheelSpeeds.h" -#include "kinematics.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveKinematicsProtoTest.cpp b/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveKinematicsProtoTest.cpp index c601fc3b4d..fd1b4d1526 100644 --- a/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveKinematicsProtoTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveKinematicsProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/kinematics/MecanumDriveKinematics.h" -#include "kinematics.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveWheelPositionsProtoTest.cpp b/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveWheelPositionsProtoTest.cpp index e63ffbeadd..fae1f0b33e 100644 --- a/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveWheelPositionsProtoTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveWheelPositionsProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/kinematics/MecanumDriveWheelPositions.h" -#include "kinematics.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveWheelSpeedsProtoTest.cpp b/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveWheelSpeedsProtoTest.cpp index ae91c3a1eb..26a98b4cb6 100644 --- a/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveWheelSpeedsProtoTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/proto/MecanumDriveWheelSpeedsProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/kinematics/MecanumDriveWheelSpeeds.h" -#include "kinematics.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp b/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp index 80af48935f..776d2b4756 100644 --- a/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp @@ -2,6 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "../../ProtoTestBase.h" diff --git a/wpimath/src/test/native/cpp/kinematics/proto/SwerveModulePositionProtoTest.cpp b/wpimath/src/test/native/cpp/kinematics/proto/SwerveModulePositionProtoTest.cpp index c511b9f840..4a3013e6f8 100644 --- a/wpimath/src/test/native/cpp/kinematics/proto/SwerveModulePositionProtoTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/proto/SwerveModulePositionProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/kinematics/SwerveModulePosition.h" -#include "kinematics.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/kinematics/proto/SwerveModuleStateProtoTest.cpp b/wpimath/src/test/native/cpp/kinematics/proto/SwerveModuleStateProtoTest.cpp index e210db9479..c86152d93a 100644 --- a/wpimath/src/test/native/cpp/kinematics/proto/SwerveModuleStateProtoTest.cpp +++ b/wpimath/src/test/native/cpp/kinematics/proto/SwerveModuleStateProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/kinematics/SwerveModuleState.h" -#include "kinematics.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/system/plant/proto/DCMotorProtoTest.cpp b/wpimath/src/test/native/cpp/system/plant/proto/DCMotorProtoTest.cpp index d977cf4e71..2c4a6747df 100644 --- a/wpimath/src/test/native/cpp/system/plant/proto/DCMotorProtoTest.cpp +++ b/wpimath/src/test/native/cpp/system/plant/proto/DCMotorProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/system/plant/DCMotor.h" -#include "plant.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryProtoTest.cpp b/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryProtoTest.cpp index 400689bf84..eb60c9dd01 100644 --- a/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryProtoTest.cpp +++ b/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/trajectory/Trajectory.h" -#include "trajectory.pb.h" using namespace frc; diff --git a/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryStateProtoTest.cpp b/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryStateProtoTest.cpp index 1d0b0497de..4f3e42c097 100644 --- a/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryStateProtoTest.cpp +++ b/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryStateProtoTest.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. +#include #include #include "frc/trajectory/Trajectory.h" -#include "trajectory.pb.h" using namespace frc; diff --git a/wpiutil/CMakeLists.txt b/wpiutil/CMakeLists.txt index 9793fef4aa..0362b7880c 100644 --- a/wpiutil/CMakeLists.txt +++ b/wpiutil/CMakeLists.txt @@ -121,6 +121,9 @@ file( src/main/native/thirdparty/mpack/src/*.cpp ) list(REMOVE_ITEM wpiutil_native_src ${wpiutil_jni_src}) +if(NOT WITH_PROTOBUF) + list(FILTER wpiutil_native_src EXCLUDE REGEX "/protobuf/") +endif() file(GLOB_RECURSE wpiutil_unix_src src/main/native/unix/*.cpp) file(GLOB_RECURSE wpiutil_linux_src src/main/native/linux/*.cpp) file(GLOB_RECURSE wpiutil_macos_src src/main/native/macOS/*.cpp) @@ -143,7 +146,12 @@ if(MSVC) target_compile_definitions(wpiutil PRIVATE -D_CRT_SECURE_NO_WARNINGS) endif() wpilib_target_warnings(wpiutil) -target_link_libraries(wpiutil protobuf::libprotobuf Threads::Threads ${CMAKE_DL_LIBS}) +if(WITH_PROTOBUF) + target_link_libraries(wpiutil protobuf::libprotobuf Threads::Threads ${CMAKE_DL_LIBS}) +else() + target_link_libraries(wpiutil Threads::Threads ${CMAKE_DL_LIBS}) + target_compile_definitions(wpiutil PUBLIC NO_PROTOBUF) +endif() if(ATOMIC) target_link_libraries(wpiutil ${ATOMIC})