Add build_type string to version.c

This commit is contained in:
Nils O. Selåsdal
2014-01-03 00:53:37 +01:00
parent c1a04820f4
commit 74b6a65bd2
3 changed files with 12 additions and 1 deletions
+8 -1
View File
@@ -71,6 +71,7 @@ AddOption('--32',
build_type = GetOption('build_type')
assertions = GetOption('assertions')
stack_protection = GetOption('stack_protection')
test_xml = GetOption('test_xml')
prefix = GetOption('prefix')
if not (build_type in ['debug', 'release']):
@@ -112,7 +113,7 @@ if build_type == 'release':
elif build_type == 'debug':
env.Append(CPPDEFINES = ['DEBUG'])
if GetOption('stack_protection'):
if stack_protection:
env.Append(CFLAGS = ['-fstack-protector', '--param=ssp-buffer-size=4'])
env.Append(CPPDEFINES = ['_FORTIFY_SOURCE=2'])
@@ -123,6 +124,12 @@ if GetOption('coverage'):
# Generate substitute dictionary
subst_info = dict(('@' + key + '@', version_info[key]) for key in version_info)
subst_info['@prefix@'] = prefix
subst_info['@build_type@'] = build_type
if assertions:
subst_info['@build_type@'] += '_A'
if stack_protection:
subst_info['@build_type@'] += '_SP'
subst_info['@build_host@'] = platform.node()
Export('env', 'build_type', 'prefix', 'version_info', 'test_xml', 'subst_info')