Commit 3be20204 authored by Dominik Charousset's avatar Dominik Charousset

Replace clumsy flag management with #cmakedefine

parent 423f372e
......@@ -368,10 +368,8 @@ endif()
# configure build_config.hpp header #
################################################################################
if(CAF_LOG_LEVEL)
set(CAF_LOG_LEVEL_INT ${CAF_LOG_LEVEL})
else()
set(CAF_LOG_LEVEL_INT -1)
if(NOT CAF_LOG_LEVEL)
set(CAF_LOG_LEVEL "-1")
endif()
macro(to_int_value name)
......
......@@ -21,19 +21,11 @@
// this header is auto-generated by CMake
#if @CAF_LOG_LEVEL_INT@ != -1
#define CAF_LOG_LEVEL @CAF_LOG_LEVEL@
#endif
#if @CAF_NO_MEM_MANAGEMENT_INT@ != -1
#define CAF_NO_MEM_MANAGEMENT
#endif
#cmakedefine CAF_NO_MEM_MANAGEMENT
#if @CAF_ENABLE_RUNTIME_CHECKS_INT@ != -1
#define CAF_ENABLE_RUNTIME_CHECKS
#endif
#cmakedefine CAF_ENABLE_RUNTIME_CHECKS
#if @CAF_NO_EXCEPTIONS_INT@ != -1
#define CAF_NO_EXCEPTIONS
#endif
#cmakedefine CAF_NO_EXCEPTIONS
......@@ -360,7 +360,7 @@ bool operator==(const logger::field& x, const logger::field& y);
#define CAF_LOG_COMPONENT "caf"
#endif // CAF_LOG_COMPONENT
#ifndef CAF_LOG_LEVEL
#if CAF_LOG_LEVEL == -1
#define CAF_LOG_IMPL(unused1, unused2, unused3)
......
......@@ -53,10 +53,7 @@ constexpr const char* log_level_name[] = {
"TRACE"
};
#ifdef CAF_LOG_LEVEL
static_assert(CAF_LOG_LEVEL >= 0 && CAF_LOG_LEVEL <= 4,
"assertion: 0 <= CAF_LOG_LEVEL <= 4");
#if CAF_LOG_LEVEL >= 0
#if defined(CAF_NO_THREAD_LOCAL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment