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

Replace clumsy flag management with #cmakedefine

parent 423f372e
...@@ -368,10 +368,8 @@ endif() ...@@ -368,10 +368,8 @@ endif()
# configure build_config.hpp header # # configure build_config.hpp header #
################################################################################ ################################################################################
if(CAF_LOG_LEVEL) if(NOT CAF_LOG_LEVEL)
set(CAF_LOG_LEVEL_INT ${CAF_LOG_LEVEL}) set(CAF_LOG_LEVEL "-1")
else()
set(CAF_LOG_LEVEL_INT -1)
endif() endif()
macro(to_int_value name) macro(to_int_value name)
......
...@@ -21,19 +21,11 @@ ...@@ -21,19 +21,11 @@
// this header is auto-generated by CMake // this header is auto-generated by CMake
#if @CAF_LOG_LEVEL_INT@ != -1
#define CAF_LOG_LEVEL @CAF_LOG_LEVEL@ #define CAF_LOG_LEVEL @CAF_LOG_LEVEL@
#endif
#if @CAF_NO_MEM_MANAGEMENT_INT@ != -1 #cmakedefine CAF_NO_MEM_MANAGEMENT
#define CAF_NO_MEM_MANAGEMENT
#endif
#if @CAF_ENABLE_RUNTIME_CHECKS_INT@ != -1 #cmakedefine CAF_ENABLE_RUNTIME_CHECKS
#define CAF_ENABLE_RUNTIME_CHECKS
#endif
#if @CAF_NO_EXCEPTIONS_INT@ != -1 #cmakedefine CAF_NO_EXCEPTIONS
#define CAF_NO_EXCEPTIONS
#endif
...@@ -360,7 +360,7 @@ bool operator==(const logger::field& x, const logger::field& y); ...@@ -360,7 +360,7 @@ bool operator==(const logger::field& x, const logger::field& y);
#define CAF_LOG_COMPONENT "caf" #define CAF_LOG_COMPONENT "caf"
#endif // CAF_LOG_COMPONENT #endif // CAF_LOG_COMPONENT
#ifndef CAF_LOG_LEVEL #if CAF_LOG_LEVEL == -1
#define CAF_LOG_IMPL(unused1, unused2, unused3) #define CAF_LOG_IMPL(unused1, unused2, unused3)
......
...@@ -53,10 +53,7 @@ constexpr const char* log_level_name[] = { ...@@ -53,10 +53,7 @@ constexpr const char* log_level_name[] = {
"TRACE" "TRACE"
}; };
#ifdef CAF_LOG_LEVEL #if CAF_LOG_LEVEL >= 0
static_assert(CAF_LOG_LEVEL >= 0 && CAF_LOG_LEVEL <= 4,
"assertion: 0 <= CAF_LOG_LEVEL <= 4");
#if defined(CAF_NO_THREAD_LOCAL) #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