introduce --with-assertions to build a release with assertions enabled
This commit is contained in:
+10
-2
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user