diff options
author | David Robillard <d@drobilla.net> | 2018-06-16 10:26:47 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-01-05 17:12:38 +0100 |
commit | 0f943c203ae9653efabb8168b82d2e56898c5fac (patch) | |
tree | ce32ff3f75525edfe02d08395350a44e0a93be75 /wscript | |
parent | 6650e22960f4dcd7d66dc560aae0347dc3272e1d (diff) | |
download | serd-0f943c203ae9653efabb8168b82d2e56898c5fac.tar.gz serd-0f943c203ae9653efabb8168b82d2e56898c5fac.tar.bz2 serd-0f943c203ae9653efabb8168b82d2e56898c5fac.zip |
WIP: Add C++ bindings
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -21,6 +21,7 @@ out = 'build' # Build directory def options(ctx): ctx.load('compiler_c') + ctx.load('compiler_cxx') autowaf.set_options(ctx, test=True) opt = ctx.get_option_group('Configuration options') autowaf.add_flags( @@ -39,8 +40,10 @@ def options(ctx): def configure(conf): autowaf.display_header('Serd Configuration') conf.load('compiler_c', cache=True) + conf.load('compiler_cxx', cache=True) conf.load('autowaf', cache=True) autowaf.set_c_lang(conf, 'c99') + autowaf.set_cxx_lang(conf, 'c++11') conf.env.update({ 'BUILD_UTILS': not Options.options.no_utils, @@ -127,7 +130,7 @@ lib_source = ['src/base64.c', def build(bld): # C Headers includedir = '${INCLUDEDIR}/serd-%s/serd' % SERD_MAJOR_VERSION - bld.install_files(includedir, bld.path.ant_glob('serd/*.h')) + bld.install_files(includedir, bld.path.ant_glob('serd/*.h*')) # Pkgconfig file autowaf.build_pc(bld, 'SERD', SERD_VERSION, SERD_MAJOR_VERSION, [], @@ -167,6 +170,7 @@ def build(bld): if bld.env.BUILD_TESTS: test_args = {'includes': ['.', './src'], 'cflags': [''] if bld.env.NO_COVERAGE else ['--coverage'], + 'cxxflags': [''] if bld.env.NO_COVERAGE else ['--coverage', '-fno-inline'], 'linkflags': [''] if bld.env.NO_COVERAGE else ['--coverage'], 'lib': lib_args['lib'], 'install_path': ''} @@ -193,6 +197,13 @@ def build(bld): defines = defines, **test_args) + bld(features = 'cxx cxxprogram', + source = 'tests/serd_cxx_test.cpp', + use = 'libserd_profiled', + target = 'serd_cxx_test', + defines = defines, + **test_args) + # Utilities if bld.env.BUILD_UTILS: for i in ['serdi', 'serd_validate']: @@ -535,14 +546,16 @@ def test(ctx): srcdir = ctx.path.abspath() os.environ['PATH'] = '.' + os.pathsep + os.getenv('PATH') - autowaf.pre_test(ctx, APPNAME) + dirs = ['.', 'src', 'tests'] + autowaf.pre_test(ctx, APPNAME, dirs=dirs) autowaf.run_tests(ctx, APPNAME, ['serd_test', + 'serd_cxx_test', 'read_chunk_test', 'nodes_test', 'overflow_test', 'model_test'], - name='Unit') + dirs=dirs, name='Unit') def test_syntax_io(in_name, expected_name, lang): in_path = 'tests/good/%s' % in_name @@ -608,7 +621,7 @@ def test(ctx): for opts in ['', '-m']: run_test_suites(ctx, opts) - autowaf.post_test(ctx, APPNAME) + autowaf.post_test(ctx, APPNAME, dirs=dirs) def posts(ctx): path = str(ctx.path.abspath()) |