diff options
author | David Robillard <d@drobilla.net> | 2018-06-16 10:26:47 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-11-25 22:12:48 +0100 |
commit | a70ee297d71d03c004e78aa1061877f231cfd8d2 (patch) | |
tree | 7f0095fcda00b69901d1f133e7c8b4ffc358884b /wscript | |
parent | 535bc536f0541792b0bab84041e7d82eaa457368 (diff) | |
download | serd-a70ee297d71d03c004e78aa1061877f231cfd8d2.tar.gz serd-a70ee297d71d03c004e78aa1061877f231cfd8d2.tar.bz2 serd-a70ee297d71d03c004e78aa1061877f231cfd8d2.zip |
WIP: Add C++ bindings
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 25 |
1 files changed, 19 insertions, 6 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, @@ -126,7 +129,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, [], @@ -165,6 +168,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', '-fno-inline-small-functions', '-fno-default-inline'], 'linkflags': [''] if bld.env.NO_COVERAGE else ['--coverage'], 'lib': lib_args['lib'], 'install_path': ''} @@ -191,6 +195,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']: @@ -219,8 +230,8 @@ def build(bld): bld.install_files('${MANDIR}/man1', 'doc/serdi.1') bld.add_post_fun(autowaf.run_ldconfig) - if bld.env.DOCS: - bld.add_post_fun(lambda ctx: autowaf.make_simple_dox(APPNAME)) + # if bld.env.DOCS: + # bld.add_post_fun(lambda ctx: autowaf.make_simple_dox(APPNAME)) def lint(ctx): "checks code for style issues" @@ -531,14 +542,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 @@ -604,7 +617,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()) |