diff --git a/deps/ox/src/ox/std/CMakeLists.txt b/deps/ox/src/ox/std/CMakeLists.txt index f1640968..3bf0e377 100644 --- a/deps/ox/src/ox/std/CMakeLists.txt +++ b/deps/ox/src/ox/std/CMakeLists.txt @@ -38,12 +38,11 @@ if(NOT OX_BARE_METAL) ) endif() -if(OX_USE_STDLIB) - target_compile_definitions( - OxStd PUBLIC - OX_USE_STDLIB - ) -endif() +target_compile_definitions( + OxStd PUBLIC + $<$:OX_USE_STDLIB> + $<$:OX_NODEBUG> +) target_link_libraries( OxStd PUBLIC diff --git a/deps/ox/src/ox/std/defines.hpp b/deps/ox/src/ox/std/defines.hpp index d37c3fb7..b90ee810 100644 --- a/deps/ox/src/ox/std/defines.hpp +++ b/deps/ox/src/ox/std/defines.hpp @@ -10,6 +10,12 @@ namespace ox::defines { +#if defined(OX_NODEBUG) +constexpr bool NoDebug = true; +#else +constexpr bool NoDebug = false; +#endif + #if defined(OX_USE_STDLIB) constexpr auto UseStdLib = true; #else diff --git a/deps/ox/src/ox/std/trace.hpp b/deps/ox/src/ox/std/trace.hpp index de107700..b47b93f2 100644 --- a/deps/ox/src/ox/std/trace.hpp +++ b/deps/ox/src/ox/std/trace.hpp @@ -175,5 +175,10 @@ void init(); #define oxTracef(ch, fmt, ...) ox::trace::TraceStream(__FILE__, __LINE__, ch, ox::detail::fmtSegments(fmt), ##__VA_ARGS__) #endif +#ifndef OX_NODEBUG #define oxDebug(...) oxTrace("debug", __VA_ARGS__) #define oxDebugf(...) oxTracef("debug", __VA_ARGS__) +#else +#define oxDebug(...) static_assert(false, "Debug prints were checked in."); oxTrace("debug", __VA_ARGS__) +#define oxDebugf(...) static_assert(false, "Debug prints were checked in."); oxTracef("debug", __VA_ARGS__) +#endif