Skip to content

Commit 190b3d1

Browse files
committed
BLD: add "coverage" as scons build mode.
scons `build` variable can now be set to "coverage". Remove the unnecessary scons variable "coverage". This closes #10.
1 parent 3ea6972 commit 190b3d1

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

SConstruct

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ vars.Add(PathVariable(
6565
vars.Add(EnumVariable(
6666
'build',
6767
'compiler settings',
68-
'fast', allowed_values=('debug', 'fast')))
68+
'fast', allowed_values=('fast', 'debug', 'coverage')))
6969
vars.Add(EnumVariable(
7070
'tool',
7171
'C++ compiler toolkit to be used',
@@ -76,9 +76,6 @@ vars.Add(BoolVariable(
7676
vars.Add(BoolVariable(
7777
'profile',
7878
'build with profiling information', False))
79-
vars.Add(BoolVariable(
80-
'coverage',
81-
'build for code coverage analysis', False))
8279
vars.Add(
8380
'tests',
8481
'fixed-string patterns for selecting unit tests', None)
@@ -91,7 +88,6 @@ env.Help(MY_SCONS_HELP % vars.GenerateHelpText(env))
9188
env['has_objcryst'] = None
9289
btags = [env['build'], platform.machine()]
9390
if env['profile']: btags.append('profile')
94-
if env['coverage']: btags.append('coverage')
9591
builddir = env.Dir('build/' + '-'.join(btags))
9692

9793
Export('env')

src/SConscript

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ else:
4444
# Configure build variants
4545
if env['build'] == 'debug':
4646
env.Append(CCFLAGS='-g')
47+
elif env['build'] == 'coverage':
48+
env.Append(CCFLAGS=['-g', '--coverage', '-O0'])
49+
env.Append(LINKFLAGS='--coverage')
4750
elif env['build'] == 'fast':
4851
env.AppendUnique(CCFLAGS=['-O3'] + fast_optimflags)
4952
env.AppendUnique(CPPDEFINES={'NDEBUG' : None})
@@ -53,9 +56,6 @@ if env['profile']:
5356
env.AppendUnique(CCFLAGS='-pg')
5457
env.AppendUnique(LINKFLAGS='-pg')
5558

56-
if env['coverage']:
57-
env.Append(CCFLAGS=['--coverage', '-O0'])
58-
env.Append(LINKFLAGS='--coverage')
5959

6060
# configure boost and ObjCryst libraries unless non-relevant.
6161
skip_configure = (GetOption('clean') or GetOption('help') or

0 commit comments

Comments
 (0)