Browse Source

Fix Prometheus Remote Write build (#8411)

Vladimir Kobal 5 years ago
parent
commit
7901ae9b05
3 changed files with 3 additions and 2 deletions
  1. 1 0
      CMakeLists.txt
  2. 1 1
      backends/prometheus/remote_write/remote_write.cc
  3. 1 1
      configure.ac

+ 1 - 0
CMakeLists.txt

@@ -1059,6 +1059,7 @@ endif()
         PRIVATE
         -DUNIT_TESTING
     )
+    target_include_directories(${TEST_NAME}_testdriver PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
     target_link_options(
         ${TEST_NAME}_testdriver
         PRIVATE

+ 1 - 1
backends/prometheus/remote_write/remote_write.cc

@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-3.0-or-later
 
 #include <snappy.h>
-#include "../../../exporting/prometheus/remote_write/remote_write.pb.h"
+#include "remote_write.pb.h"
 #include "remote_write.h"
 
 using namespace prometheus;

+ 1 - 1
configure.ac

@@ -1088,7 +1088,7 @@ if test "${enable_backend_prometheus_remote_write}" != "no" -a "${have_libprotob
                                                            -a "${have_protoc}" = "yes" -a "${have_CXX_compiler}" = "yes"; then
     enable_backend_prometheus_remote_write="yes"
     AC_DEFINE([ENABLE_PROMETHEUS_REMOTE_WRITE], [1], [Prometheus remote write API usability])
-    OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${PROTOBUF_CFLAGS} ${SNAPPY_CFLAGS}"
+    OPTIONAL_PROMETHEUS_REMOTE_WRITE_CFLAGS="${PROTOBUF_CFLAGS} ${SNAPPY_CFLAGS} -Iexporting/prometheus/remote_write"
     CXX11FLAG="-std=c++11"
     OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS="${PROTOBUF_LIBS} ${SNAPPY_LIBS}"
 else