mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
[wpiutil,glass,dlt] Replace libprotobuf with upb for dynamic decode (#7988)
libprotobuf is a very annoying dependency to deal with, and with the switch to nanopb for generated C++ code, libprotobuf is only used for dynamic decode in the GUI apps. libprotobuf has been swapped out with upb, a much smaller C-based library that supports reflection and can therefore do dynamic decode. This means we can remove the libprotobuf dependency and stop dealing with build issues because of it.
This commit is contained in:
@@ -110,13 +110,18 @@ 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)) {
|
||||
upb_Status status;
|
||||
status.ok = true;
|
||||
upb_DefPool_AddFile(
|
||||
m_protoPool,
|
||||
google_protobuf_FileDescriptorProto_parse(
|
||||
reinterpret_cast<const char*>(data.data()), data.size(), m_arena),
|
||||
&status);
|
||||
if (!status.ok) {
|
||||
wpi::print("could not decode protobuf '{}' filename '{}'\n", name,
|
||||
*filename);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user