diff --git a/meson.build b/meson.build index 22ee4bf0..b902c80a 100644 --- a/meson.build +++ b/meson.build @@ -15,6 +15,10 @@ if not have_xwayland add_project_arguments('-DNO_XWAYLAND', language: 'cpp') endif +if get_option('buildtype') == 'debug' + add_project_arguments('-DHYPRLAND_DEBUG', language: 'cpp') +endif + subdir('protocols') subdir('src') subdir('hyprctl') diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 83656e13..66a8128d 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -114,6 +114,9 @@ std::string versionRequest() { #ifndef NDEBUG result += "debug\n"; #endif +#ifdef HYPRLAND_DEBUG + result += "debug\n"; +#endif #ifdef NO_XWAYLAND result += "no xwayland\n"; #endif diff --git a/src/defines.hpp b/src/defines.hpp index 18db3955..80750c23 100644 --- a/src/defines.hpp +++ b/src/defines.hpp @@ -7,10 +7,14 @@ #include "wlrunstable/wlr_ext_workspace_v1.hpp" #ifndef NDEBUG +#ifdef HYPRLAND_DEBUG #define ISDEBUG true #else #define ISDEBUG false #endif +#else +#define ISDEBUG false +#endif #define RIP(format, ... ) { fprintf(stderr, format "\n", ##__VA_ARGS__); exit(EXIT_FAILURE); }