diff --git a/core/meson.build b/core/meson.build index cad35decec..1295efb33d 100644 --- a/core/meson.build +++ b/core/meson.build @@ -41,6 +41,11 @@ cc = meson.get_compiler('c') # For now, we use KMN_KBP to inject the km::kbp::kmx namespace defns = ['-DKMN_KBP'] +# #define DEBUG when we are on a debug build +if get_option('buildtype') == 'debug' + add_global_arguments('-DDEBUG', language : 'cpp') +endif + subdir('doc') subdir('include') subdir('src') diff --git a/core/src/kmx/kmx_plus.h b/core/src/kmx/kmx_plus.h index 74dfac4046..33feac07c8 100644 --- a/core/src/kmx/kmx_plus.h +++ b/core/src/kmx/kmx_plus.h @@ -15,8 +15,12 @@ * @def KMXPLUS_DEBUG Set to 1 to enable debug output */ #ifndef KMXPLUS_DEBUG +#if defined(DEBUG) +#define KMXPLUS_DEBUG 1 +#else #define KMXPLUS_DEBUG 0 #endif +#endif namespace km { namespace kbp {