Hot-fix the NDEBUG, which affected default builds that users might not expect

if they follow the build instructions.
This commit is contained in:
Jim Derry 2017-10-07 14:07:12 -04:00
parent 4e6d76eb01
commit f26b198213
3 changed files with 28 additions and 11 deletions

View file

@ -136,12 +136,29 @@ endif ()
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# Memory Diagnostics # Diagnostics
# Enable building with some memory diagnostics. # Enable building with logs, some memory diagnostics.
# #
# NOTE: Currently only available in the Debug configuration build in # - ensure that NDEBUG is applied by default, so that default builds
# Windows, but could be maybe extended to Unix, others... # don't spew debugging messages everywhere, except MSVC builds,
# where this is already expected behavior.
# - allow other diagnostic tools.
#------------------------------------------------------------------------ #------------------------------------------------------------------------
add_definitions( -DNDEBUG )
if (MSVC AND NOT CMAKE_BUILD_TYPE MATCHES Release)
option( ENABLE_DEBUG_LOG "Set ON to output debugging messages." ON )
else ()
option( ENABLE_DEBUG_LOG "Set ON to output debugging messages." OFF )
endif ()
if ( ENABLE_DEBUG_LOG )
remove_definitions ( -DNDEBUG )
message(STATUS "*** Debug Logging is enabled.")
else ()
message(STATUS "*** Debug Logging is NOT enabled.")
endif ()
option( ENABLE_ALLOC_DEBUG "Set ON to output node allocation diagnostics." OFF ) option( ENABLE_ALLOC_DEBUG "Set ON to output node allocation diagnostics." OFF )
option( ENABLE_MEMORY_DEBUG "Set ON to output some memory diagnostics." OFF ) option( ENABLE_MEMORY_DEBUG "Set ON to output some memory diagnostics." OFF )

View file

@ -322,10 +322,10 @@ static uint GetVersFromFPI(ctmbstr fpi)
return 0; return 0;
} }
#if defined(_MSC_VER) #ifndef NDEBUG
#ifndef EndBuf # ifndef EndBuf
# define EndBuf(a) ( a + strlen(a) ) # define EndBuf(a) ( a + strlen(a) )
#endif # endif
/* Issue #377 - Output diminishing version bits */ /* Issue #377 - Output diminishing version bits */
typedef struct tagV2S { typedef struct tagV2S {

View file

@ -1,2 +1,2 @@
5.5.59 5.5.60
2017.10.06 2017.10.07