| 1 |
Author: Reiner Herrmann <[email protected]> |
| 2 |
Description: Build with system nanopb |
| 3 |
|
| 4 |
--- a/src/proto/CMakeLists.txt |
| 5 |
+++ b/src/proto/CMakeLists.txt |
| 6 |
@@ -5,8 +5,9 @@ |
| 7 |
|
| 8 |
# Note: uncomment below line to build new proto files |
| 9 |
# nanopb_generate_cpp(PROTO_SRCS PROTO_HDRS msg.proto) |
| 10 |
|
| 11 |
|
| 12 |
+set(PROTO_SRCS "msg.pb.c") |
| 13 |
+set(PROTO_HDRS "msg.pb.h") |
| 14 |
|
| 15 |
include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
| 16 |
add_library(cdogs_proto STATIC ${PROTO_SRCS} ${PROTO_HDRS} msg.options msg.proto) |
| 17 |
+target_link_libraries(cdogs_proto protobuf-nanopb) |
| 18 |
--- a/src/cdogs/net_client.c |
| 19 |
+++ b/src/cdogs/net_client.c |
| 20 |
@@ -31,7 +31,7 @@ |
| 21 |
#include <errno.h> |
| 22 |
#include <string.h> |
| 23 |
|
| 24 |
|
| 25 |
+#include <nanopb/pb_decode.h> |
| 26 |
#include "actors.h" |
| 27 |
#include "campaigns.h" |
| 28 |
#include "game_events.h" |
| 29 |
--- a/src/cdogs/net_server.c |
| 30 |
+++ b/src/cdogs/net_server.c |
| 31 |
@@ -30,7 +30,7 @@ |
| 32 |
|
| 33 |
#include <string.h> |
| 34 |
|
| 35 |
|
| 36 |
+#include <nanopb/pb_encode.h> |
| 37 |
|
| 38 |
#include "actor_placement.h" |
| 39 |
#include "ai_utils.h" |
| 40 |
--- a/src/cdogs/net_util.c |
| 41 |
+++ b/src/cdogs/net_util.c |
| 42 |
@@ -28,8 +28,8 @@ |
| 43 |
*/ |
| 44 |
#include "net_util.h" |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
+#include <nanopb/pb_decode.h> |
| 49 |
+#include <nanopb/pb_encode.h> |
| 50 |
|
| 51 |
ENetPacket *NetEncode(const GameEventType e, const void *data) |
| 52 |
{ |