From 4304e013432eff6b643bb61299356a225c834410 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 6 Jul 2013 20:45:39 +0200 Subject: [PATCH] Add --coverage option to SConstruct file to build with gcov coverage support --- SConstruct | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SConstruct b/SConstruct index d32cd4d..7b7f1c4 100644 --- a/SConstruct +++ b/SConstruct @@ -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()