Add --coverage option to SConstruct file to build with gcov coverage
support
This commit is contained in:
@@ -36,6 +36,12 @@ AddOption('--test_xml',
|
||||
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',
|
||||
dest = 'stack_protection',
|
||||
action='store_true',
|
||||
@@ -85,6 +91,9 @@ if GetOption('stack_protection'):
|
||||
env.Append(CFLAGS = ['-fstack-protector', '--param=ssp-buffer-size=4'])
|
||||
env.Append(CPPDEFINES = ['_FORTIFY_SOURCE=2'])
|
||||
|
||||
if GetOption('coverage'):
|
||||
env.Append(CFLAGS = ['--coverage'])
|
||||
env.Append(LINKFLAGS = ['--coverage'])
|
||||
|
||||
#put all .sconsign files in one place
|
||||
env.SConsignFile()
|
||||
|
||||
Reference in New Issue
Block a user