aboutsummaryrefslogtreecommitdiffstats
path: root/logd/src/logd/CMakeLists.txt
blob: 865d810fe0e93262c54bd3bd0d3936cd0e54e640 (plain) (blame)
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
# 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.
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
  set_source_files_properties(${logd_PROTOBUF_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-array-bounds -Wno-suggest-override")
endif()

vespa_add_library(logd STATIC
    SOURCES
    config_subscriber.cpp
    empty_forwarder.cpp
    metrics.cpp
    proto_converter.cpp
    rpc_forwarder.cpp
    state_reporter.cpp
    watcher.cpp
    ${logd_PROTOBUF_SRCS}

    DEPENDS
)

vespa_generate_config(logd ../main/resources/configdefinitions/logd.def)
install_config_definition(../main/resources/configdefinitions/logd.def cloud.config.log.logd.def)

vespa_add_target_package_dependency(logd Protobuf)