Skip to content

Commit

Permalink
Don't overwrite all of CFLAGS/CXXFLAGS in prometheus-cpp build
Browse files Browse the repository at this point in the history
We only really care about the -DDEBUG flag. We need to pass other flags
down from various builds such as the binary builds on OBS.
  • Loading branch information
timwoj committed Jun 6, 2024
1 parent 5d9f05a commit 6b5845d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions FindPrometheusCpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ set(prometheuscpp_src "${CMAKE_CURRENT_SOURCE_DIR}/auxil/prometheus-cpp")
set(_sharedlibs ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF)

# These need to be reset before setting up Prometheus because otherwise it picks up
# the -DDEBUG from SetDefaultCompileFlags and causes civetweb to output a bunch of
# debugging information. Let the library figure out its own flags.
# The -DDEBUG flag from SetDefaultCompileFlags causes civetweb in prometheus-cpp
# to output a bunch of debugging information. Remove it from the flags before
# allowing them to pass through to the prometheus-cpp build.
set(_cxxflags ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "")
set(_cflags ${CMAKE_C_FLAGS})
set(CMAKE_C_FLAGS "")

string(REPLACE "-DDEBUG" "" CMAKE_CXX_FLAGS "${_cxxflags}")
string(REPLACE "-DDEBUG" "" CMAKE_C_FLAGS "${_cflags}")

option(ENABLE_PUSH "" OFF)
option(ENABLE_TESTING "" OFF)
Expand All @@ -25,7 +26,6 @@ message("=======================================================================

set(zeekdeps ${zeekdeps} prometheus-cpp::core prometheus-cpp::pull)
include_directories(BEFORE ${prometheuscpp_src}/pull/include ${prometheuscpp_src}/core/include)
#include_directories(BEFORE ${prometheuscpp_src}/3rdparty/civetweb/include)
include_directories(BEFORE ${prometheuscpp_build}/pull/include ${prometheuscpp_build}/core/include)

set(BUILD_SHARED_LIBS ${_sharedlibs})
Expand Down

0 comments on commit 6b5845d

Please sign in to comment.