summaryrefslogtreecommitdiff
path: root/dev-util/android-tools/files/android-tools-34.0.0-protobuf.patch
blob: d7aa309410a41039560dff93c905ccf4a03c7acd (plain)
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
https://bugs.gentoo.org/912789
https://github.com/nmeum/android-tools/commit/c5eae90a06072c6982e483f8154e490b47e620f7
https://github.com/nmeum/android-tools/pull/120#issuecomment-1621066529

--- a/vendor/CMakeLists.txt
+++ b/vendor/CMakeLists.txt
@@ -73,6 +73,8 @@
 pkg_check_modules(libzstd REQUIRED IMPORTED_TARGET libzstd)
 
+find_package(Protobuf CONFIG)
 find_package(Protobuf REQUIRED)
+set(PROTOBUF_LIBRARIES protobuf::libprotobuf)
 set(THREADS_PREFER_PTHREAD_FLAG ON)
 find_package(Threads REQUIRED)
 
--- a/vendor/extras/libjsonpb/parse/jsonpb.cpp
+++ b/vendor/extras/libjsonpb/parse/jsonpb.cpp
@@ -50,8 +50,10 @@
   if (!status.ok()) {
 #if GOOGLE_PROTOBUF_VERSION < 3016000
     return MakeError<std::string>(status.error_message().as_string());
-#else
+#elif GOOGLE_PROTOBUF_VERSION < 4022000
     return MakeError<std::string>(status.message().as_string());
+#else
+    return MakeError<std::string>(std::string(status.message()));
 #endif
   }
   return ErrorOr<std::string>(std::move(json));
@@ -67,8 +69,10 @@
   if (!status.ok()) {
 #if GOOGLE_PROTOBUF_VERSION < 3016000
     return MakeError<std::monostate>(status.error_message().as_string());
-#else
+#elif GOOGLE_PROTOBUF_VERSION < 4022000
     return MakeError<std::monostate>(status.message().as_string());
+#else
+    return MakeError<std::monostate>(std::string(status.message()));
 #endif
   }
   if (!message->ParseFromString(binary)) {