[ox/std] Make oxDebug trigger build failure if OX_NODEBUG is set to ON
This commit is contained in:
		
							
								
								
									
										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()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(OX_USE_STDLIB)
 | 
					target_compile_definitions(
 | 
				
			||||||
	target_compile_definitions(
 | 
						OxStd PUBLIC
 | 
				
			||||||
		OxStd PUBLIC
 | 
							$<$<BOOL:${OX_USE_STDLIB}>:OX_USE_STDLIB>
 | 
				
			||||||
			OX_USE_STDLIB
 | 
							$<$<BOOL:$ENV{OX_NODEBUG}>:OX_NODEBUG>
 | 
				
			||||||
	)
 | 
					)
 | 
				
			||||||
endif()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
target_link_libraries(
 | 
					target_link_libraries(
 | 
				
			||||||
	OxStd PUBLIC
 | 
						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 {
 | 
					namespace ox::defines {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(OX_NODEBUG)
 | 
				
			||||||
 | 
					constexpr bool NoDebug = true;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					constexpr bool NoDebug = false;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(OX_USE_STDLIB)
 | 
					#if defined(OX_USE_STDLIB)
 | 
				
			||||||
constexpr auto UseStdLib = true;
 | 
					constexpr auto UseStdLib = true;
 | 
				
			||||||
#else
 | 
					#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__)
 | 
					#define oxTracef(ch, fmt, ...) ox::trace::TraceStream(__FILE__, __LINE__, ch, ox::detail::fmtSegments<ox::detail::argCount(fmt)+1>(fmt), ##__VA_ARGS__)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifndef OX_NODEBUG
 | 
				
			||||||
#define oxDebug(...) oxTrace("debug", __VA_ARGS__)
 | 
					#define oxDebug(...) oxTrace("debug", __VA_ARGS__)
 | 
				
			||||||
#define oxDebugf(...) oxTracef("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
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user