From f96ac3ff6c8678685a499b9ef1bd9b2d22e2e387 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 16 Jan 2012 01:06:15 +0000 Subject: Fix test suite link errors when gcov is unavailable. git-svn-id: http://svn.drobilla.net/serd/trunk@288 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- wscript | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index 0e0c930c..689f1a46 100644 --- a/wscript +++ b/wscript @@ -147,20 +147,21 @@ def build(bld): cflags = [ '-DSERD_INTERNAL' ]) if bld.env['BUILD_TESTS']: + test_libs = ['m'] + test_cflags = [''] + if bld.is_defined('HAVE_GCOV'): + test_libs += ['gcov'] + test_cflags += ['-fprofile-arcs', '-ftest-coverage'] + # Static library (for unit test code coverage) obj = bld(features = 'c cstlib', source = lib_source, includes = ['.', './src'], - lib = ['m'], + lib = test_libs, name = 'libserd_profiled', target = 'serd_profiled', install_path = '', - cflags = [ '-fprofile-arcs', '-ftest-coverage', - '-DSERD_INTERNAL' ]) - - test_libs = ['m'] - if bld.is_defined('HAVE_GCOV'): - test_libs += ['gcov'] + cflags = test_cflags + ['-DSERD_INTERNAL']) # Unit test serdi obj = bld(features = 'c cprogram', @@ -170,7 +171,7 @@ def build(bld): lib = test_libs, target = 'serdi_static', install_path = '', - cflags = [ '-fprofile-arcs', '-ftest-coverage' ]) + cflags = test_cflags) # Unit test program obj = bld(features = 'c cprogram', @@ -180,7 +181,7 @@ def build(bld): lib = test_libs, target = 'serd_test', install_path = '', - cflags = [ '-fprofile-arcs', '-ftest-coverage' ]) + cflags = test_cflags) # Utilities if bld.env['BUILD_UTILS']: -- cgit v1.2.1