aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-01-16 01:03:38 +0000
committerDavid Robillard <d@drobilla.net>2012-01-16 01:03:38 +0000
commit43b1c1e9d1a73a5b4d85b35429aab9a964e345f3 (patch)
treec2ddc168f30fc997d5406d4ecb9051b7447e535c
parent3c3e2de8a72185f82296ec7b3dac9f6395522de8 (diff)
downloadserd-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--wscript13
1 files changed, 11 insertions, 2 deletions
diff --git a/wscript b/wscript
index 2183d326..adc06b96 100644
--- a/wscript
+++ b/wscript
@@ -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' ])