introduce --with-assertions to build a release with assertions enabled

This commit is contained in:
Nils O. Selåsdal
2013-10-05 00:55:51 +02:00
parent f2f2ed247f
commit 3da0591cc3
+8
View File
@@ -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,6 +88,7 @@ env.Append(CPPPATH = ['#include'])
if build_type == 'release':
env.Append(CFLAGS = ['-O2'])
if not assertions:
#this will turn off assert()
env.Append(CPPDEFINES = ['NDEBUG'])