Add build_type string to version.c
This commit is contained in:
+8
-1
@@ -71,6 +71,7 @@ AddOption('--32',
|
|||||||
|
|
||||||
build_type = GetOption('build_type')
|
build_type = GetOption('build_type')
|
||||||
assertions = GetOption('assertions')
|
assertions = GetOption('assertions')
|
||||||
|
stack_protection = GetOption('stack_protection')
|
||||||
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']):
|
||||||
@@ -112,7 +113,7 @@ if build_type == 'release':
|
|||||||
elif build_type == 'debug':
|
elif build_type == 'debug':
|
||||||
env.Append(CPPDEFINES = ['DEBUG'])
|
env.Append(CPPDEFINES = ['DEBUG'])
|
||||||
|
|
||||||
if GetOption('stack_protection'):
|
if stack_protection:
|
||||||
env.Append(CFLAGS = ['-fstack-protector', '--param=ssp-buffer-size=4'])
|
env.Append(CFLAGS = ['-fstack-protector', '--param=ssp-buffer-size=4'])
|
||||||
env.Append(CPPDEFINES = ['_FORTIFY_SOURCE=2'])
|
env.Append(CPPDEFINES = ['_FORTIFY_SOURCE=2'])
|
||||||
|
|
||||||
@@ -123,6 +124,12 @@ if GetOption('coverage'):
|
|||||||
# Generate substitute dictionary
|
# Generate substitute dictionary
|
||||||
subst_info = dict(('@' + key + '@', version_info[key]) for key in version_info)
|
subst_info = dict(('@' + key + '@', version_info[key]) for key in version_info)
|
||||||
subst_info['@prefix@'] = prefix
|
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()
|
subst_info['@build_host@'] = platform.node()
|
||||||
|
|
||||||
Export('env', 'build_type', 'prefix', 'version_info', 'test_xml', 'subst_info')
|
Export('env', 'build_type', 'prefix', 'version_info', 'test_xml', 'subst_info')
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ extern const char ucore_version_str[];
|
|||||||
*/
|
*/
|
||||||
extern const char ucore_build_host[];
|
extern const char ucore_build_host[];
|
||||||
|
|
||||||
|
/** The build type (release or debug)
|
||||||
|
*/
|
||||||
|
extern const char ucore_build_type[];
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ const int ucore_version_patch = @version_patch@;
|
|||||||
|
|
||||||
const char ucore_version_str[] = "@version_str@";
|
const char ucore_version_str[] = "@version_str@";
|
||||||
const char ucore_build_host[] = "@build_host@";
|
const char ucore_build_host[] = "@build_host@";
|
||||||
|
const char ucore_build_type[] = "@build_type@";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user