summaryrefslogtreecommitdiffstats
path: root/logd
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2019-03-25 09:50:36 +0000
committerGeir Storli <geirst@verizonmedia.com>2019-03-25 09:50:36 +0000
commit4fd8397c249e1416cb2cf7adfaa1a5346df70e94 (patch)
treed0ae49fa75ea6497b3a4ab0f5112c5e5133604e6 /logd
parent9eb0399b5c643ab6b042be2e0593aaa53b7880c1 (diff)
Generate and compile protobuf files for the new log protocol to communicate with the logserver.
Diffstat (limited to 'logd')
-rw-r--r--logd/src/logd/.gitignore2
-rw-r--r--logd/src/logd/CMakeLists.txt11
2 files changed, 13 insertions, 0 deletions
diff --git a/logd/src/logd/.gitignore b/logd/src/logd/.gitignore
index af2c87d8c89..6c6cb99ec9b 100644
--- a/logd/src/logd/.gitignore
+++ b/logd/src/logd/.gitignore
@@ -5,3 +5,5 @@ config-logd.cpp
config-logd.h
core
logd
+*.pb.h
+*.pb.cc
diff --git a/logd/src/logd/CMakeLists.txt b/logd/src/logd/CMakeLists.txt
index 2d40447074e..a3ff813ad96 100644
--- a/logd/src/logd/CMakeLists.txt
+++ b/logd/src/logd/CMakeLists.txt
@@ -1,4 +1,14 @@
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+# logd is the only cpp module using the protobuf files for the log protocol.
+# We have choosen to generate the cpp code where it is used, instead of changing the java logserver module to also generate and export cpp code just for this case.
+# If more cpp modules requires the cpp protobuf files we should move code generation to a common place.
+find_package(Protobuf REQUIRED)
+protobuf_generate_cpp(logd_PROTOBUF_SRCS logd_PROTOBUF_HDRS ../../../logserver/src/protobuf/log_protocol.proto)
+
+# protoc-generated files emit compiler warnings that we normally treat as errors.
+set_source_files_properties(${logd_PROTOBUF_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-suggest-override")
+
vespa_add_library(logd STATIC
SOURCES
config_subscriber.cpp
@@ -7,6 +17,7 @@ vespa_add_library(logd STATIC
metrics.cpp
state_reporter.cpp
watcher.cpp
+ ${logd_PROTOBUF_SRCS}
DEPENDS
)