[ox/std] Make oxDebug trigger build failure if OX_NODEBUG is set to ON
This commit is contained in:
parent
15d169dd12
commit
582cbf2041
11
deps/ox/src/ox/std/CMakeLists.txt
vendored
11
deps/ox/src/ox/std/CMakeLists.txt
vendored
@ -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
|
||||
$<$<BOOL:${OX_USE_STDLIB}>:OX_USE_STDLIB>
|
||||
$<$<BOOL:$ENV{OX_NODEBUG}>:OX_NODEBUG>
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
OxStd PUBLIC
|
||||
|
6
deps/ox/src/ox/std/defines.hpp
vendored
6
deps/ox/src/ox/std/defines.hpp
vendored
@ -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
|
||||
|
5
deps/ox/src/ox/std/trace.hpp
vendored
5
deps/ox/src/ox/std/trace.hpp
vendored
@ -175,5 +175,10 @@ void init();
|
||||
#define oxTracef(ch, fmt, ...) ox::trace::TraceStream(__FILE__, __LINE__, ch, ox::detail::fmtSegments<ox::detail::argCount(fmt)+1>(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
|
||||
|
Loading…
x
Reference in New Issue
Block a user