-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathprotobuf-23.patch
49 lines (45 loc) · 1.86 KB
/
protobuf-23.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fc3021f5..252ea7ee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -187,7 +187,9 @@ MESSAGE(STATUS "UPDATE TRANSLATIONS: ${UPDATE_TRANSLATIONS}")
set(CMAKE_AUTOMOC TRUE)
# Find other needed libraries
-find_package(Protobuf REQUIRED)
+find_package(Protobuf CONFIG REQUIRED)
+find_package(Protobuf REQUIRED) # for the protoc command
+set(PROTOBUF_LIBRARIES protobuf::libprotobuf)
if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
message(FATAL_ERROR "No protoc command found!")
else()
diff --git a/common/debug_pb_message.cpp b/common/debug_pb_message.cpp
index 616957a716..011cbfbf4b 100644
--- a/common/debug_pb_message.cpp
+++ b/common/debug_pb_message.cpp
@@ -8,15 +8,6 @@
#include <google/protobuf/message.h>
#include <google/protobuf/text_format.h>
-// google/protobuf/stubs/strutil.h is missing on some systems!
-namespace google
-{
-namespace protobuf
-{
-std::string CEscape(const std::string &src);
-} // namespace protobuf
-} // namespace google
-
// FastFieldValuePrinter is added in protobuf 3.4, going out of our way to add the old FieldValuePrinter is not worth it
#if GOOGLE_PROTOBUF_VERSION > 3004000
@@ -43,12 +34,7 @@ void LimitedPrinter::PrintString(const std::string &val,
::google::protobuf::TextFormat::BaseTextGenerator *generator) const
{
auto length = val.length();
- if (length > MAX_TEXT_LENGTH) {
- generator->PrintString("\"" + ::google::protobuf::CEscape(val.substr(0, MAX_NAME_LENGTH)) + "... ---snip--- (" +
- std::to_string(length) + " bytes total) \"");
- } else {
- ::google::protobuf::TextFormat::FastFieldValuePrinter::PrintString(val, generator);
- }
+ ::google::protobuf::TextFormat::FastFieldValuePrinter::PrintString(val, generator);
}
void SafePrinter::PrintString(const std::string & /*val*/,