diff options
author | David Robillard <d@drobilla.net> | 2012-01-16 01:03:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-01-16 01:03:38 +0000 |
commit | 43b1c1e9d1a73a5b4d85b35429aab9a964e345f3 (patch) | |
tree | c2ddc168f30fc997d5406d4ecb9051b7447e535c | |
parent | 3c3e2de8a72185f82296ec7b3dac9f6395522de8 (diff) | |
download | serd-43b1c1e9d1a73a5b4d85b35429aab9a964e345f3.tar.gz serd-43b1c1e9d1a73a5b4d85b35429aab9a964e345f3.tar.bz2 serd-43b1c1e9d1a73a5b4d85b35429aab9a964e345f3.zip |
Fix test suite compilation when -lgcov is unavailable.
git-svn-id: http://svn.drobilla.net/serd/trunk@286 490d8e77-9747-427b-9fa3-0b8f29cee8a0
-rw-r--r-- | wscript | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -59,6 +59,11 @@ def configure(conf): if Options.options.largefile: conf.env.append_unique('CFLAGS', '-D_FILE_OFFSET_BITS=64') + # Check for gcov library (for test coverage) + if conf.env['BUILD_TESTS']: + conf.check_cc(lib='gcov', + define_name='HAVE_GCOV') + # Check for posix_memalign conf.check(function_name='posix_memalign', header_name='stdlib.h', @@ -152,12 +157,16 @@ def build(bld): cflags = [ '-fprofile-arcs', '-ftest-coverage', '-DSERD_INTERNAL' ]) + test_libs = ['m'] + if bld.is_defined('HAVE_GCOV'): + test_libs += ['gcov'] + # Unit test serdi obj = bld(features = 'c cprogram', source = 'src/serdi.c', includes = ['.', './src'], use = 'libserd_profiled', - lib = ['m', 'gcov'], + lib = test_libs, target = 'serdi_static', install_path = '', cflags = [ '-fprofile-arcs', '-ftest-coverage' ]) @@ -167,7 +176,7 @@ def build(bld): source = 'tests/serd_test.c', includes = ['.', './src'], use = 'libserd_profiled', - lib = ['m', 'gcov'], + lib = test_libs, target = 'serd_test', install_path = '', cflags = [ '-fprofile-arcs', '-ftest-coverage' ]) |