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'
|
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',
|
AddOption('--stack-protection',
|
||||||
dest = 'stack_protection',
|
dest = 'stack_protection',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
@@ -51,6 +57,7 @@ AddOption('--stack-protection',
|
|||||||
|
|
||||||
|
|
||||||
build_type = GetOption('build_type')
|
build_type = GetOption('build_type')
|
||||||
|
assertions = GetOption('assertions')
|
||||||
test_xml = GetOption('test_xml')
|
test_xml = GetOption('test_xml')
|
||||||
prefix = GetOption('prefix')
|
prefix = GetOption('prefix')
|
||||||
if not (build_type in ['debug', 'release']):
|
if not (build_type in ['debug', 'release']):
|
||||||
@@ -81,8 +88,9 @@ env.Append(CPPPATH = ['#include'])
|
|||||||
if build_type == 'release':
|
if build_type == 'release':
|
||||||
env.Append(CFLAGS = ['-O2'])
|
env.Append(CFLAGS = ['-O2'])
|
||||||
|
|
||||||
#this will turn off assert()
|
if not assertions:
|
||||||
env.Append(CPPDEFINES = ['NDEBUG'])
|
#this will turn off assert()
|
||||||
|
env.Append(CPPDEFINES = ['NDEBUG'])
|
||||||
|
|
||||||
elif build_type == 'debug':
|
elif build_type == 'debug':
|
||||||
env.Append(CPPDEFINES = ['DEBUG'])
|
env.Append(CPPDEFINES = ['DEBUG'])
|
||||||
|
|||||||
Reference in New Issue
Block a user