diff --git a/SConstruct b/SConstruct index 7b7f1c4..94e438b 100644 --- a/SConstruct +++ b/SConstruct @@ -42,6 +42,12 @@ AddOption('--coverage', help='Build with coverage (gcov) support' ) +AddOption('--with-assertions', + dest='assertions', + action='store_true', + help='Build with assertions enabled (Default for a debug build)' +) + AddOption('--stack-protection', dest = 'stack_protection', action='store_true', @@ -51,6 +57,7 @@ AddOption('--stack-protection', build_type = GetOption('build_type') +assertions = GetOption('assertions') test_xml = GetOption('test_xml') prefix = GetOption('prefix') if not (build_type in ['debug', 'release']): @@ -81,8 +88,9 @@ env.Append(CPPPATH = ['#include']) if build_type == 'release': env.Append(CFLAGS = ['-O2']) - #this will turn off assert() - env.Append(CPPDEFINES = ['NDEBUG']) + if not assertions: + #this will turn off assert() + env.Append(CPPDEFINES = ['NDEBUG']) elif build_type == 'debug': env.Append(CPPDEFINES = ['DEBUG'])