Add --coverage option to SConstruct file to build with gcov coverage

support
This commit is contained in:
root
2013-07-06 20:45:39 +02:00
parent 65c32810cb
commit 4304e01343
+9
View File
@@ -36,6 +36,12 @@ AddOption('--test_xml',
help='Create a result.xml when running the testsuite' help='Create a result.xml when running the testsuite'
) )
AddOption('--coverage',
dest='coverage',
action='store_true',
help='Build with coverage (gcov) support'
)
AddOption('--stack-protection', AddOption('--stack-protection',
dest = 'stack_protection', dest = 'stack_protection',
action='store_true', action='store_true',
@@ -85,6 +91,9 @@ if GetOption('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'])
if GetOption('coverage'):
env.Append(CFLAGS = ['--coverage'])
env.Append(LINKFLAGS = ['--coverage'])
#put all .sconsign files in one place #put all .sconsign files in one place
env.SConsignFile() env.SConsignFile()