Verified Commit f8c52b43 authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Add missing compiler definitions for CMake Debug builds

parent db6ac1bf
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -295,6 +295,8 @@ find_package(RedisPlusPlus 1.3.3 REQUIRED)

# set compile flags
add_compile_options("-Wall" "-Wextra" "-Werror" "$<$<CONFIG:RELEASE>:-O3>")
add_compile_definitions("$<$<CONFIG:DEBUG,ASan>:SCORD_DEBUG_BUILD>")
add_compile_definitions("$<$<CONFIG:DEBUG,ASan>:__LOGGER_ENABLE_DEBUG__>")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
  add_compile_options("-stdlib=libc++")
else ()
+5 −1
Original line number Diff line number Diff line
@@ -33,6 +33,10 @@
#include <system_error>
#include <fmt/format.h>

#ifdef SCORD_DEBUG_BUILD
#include <sys/prctl.h>
#endif

#include <config/settings.hpp>
#include <logger/logger.hpp>
#include <utils/signal_listener.hpp>
@@ -348,7 +352,7 @@ server::run() {
    // validate settings
    check_configuration();

#ifdef __LOGGER_ENABLE_DEBUG__
#ifdef SCORD_DEBUG_BUILD
    if(::prctl(PR_SET_DUMPABLE, 1) != 0) {
        LOGGER_WARN("Failed to set PR_SET_DUMPABLE flag for process. "
                    "Daemon will not produce core dumps.");