diff options
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 180 |
1 files changed, 90 insertions, 90 deletions
@@ -23,104 +23,104 @@ top = '.' out = 'build' def options(opt): - autowaf.set_options(opt) - opt.add_option('--test', action='store_true', default=False, dest='build_tests', - help="Build unit tests") - opt.add_option('--dump', type='string', default='', dest='dump', - help="Dump debugging output (iter, search, write, all)") + autowaf.set_options(opt) + opt.add_option('--test', action='store_true', default=False, dest='build_tests', + help="Build unit tests") + opt.add_option('--dump', type='string', default='', dest='dump', + help="Dump debugging output (iter, search, write, all)") def configure(conf): - autowaf.configure(conf) - autowaf.display_header('Sord configuration') + autowaf.configure(conf) + autowaf.display_header('Sord configuration') - conf.load('compiler_cc') - conf.env.append_value('CFLAGS', '-std=c99') + conf.load('compiler_cc') + conf.env.append_value('CFLAGS', '-std=c99') - autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', - atleast_version='2.0.0', mandatory=True) + autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', + atleast_version='2.0.0', mandatory=True) - autowaf.check_pkg(conf, 'serd', uselib_store='SERD', - atleast_version='0.1.0', mandatory=True) + autowaf.check_pkg(conf, 'serd', uselib_store='SERD', + atleast_version='0.1.0', mandatory=True) - conf.env['BUILD_TESTS'] = Options.options.build_tests - conf.env['BUILD_UTILS'] = True + conf.env['BUILD_TESTS'] = Options.options.build_tests + conf.env['BUILD_UTILS'] = True - dump = Options.options.dump.split(',') - all = 'all' in dump - if all or 'iter' in dump: - autowaf.define(conf, 'SORD_DEBUG_ITER', 1) - if all or 'search' in dump: - autowaf.define(conf, 'SORD_DEBUG_SEARCH', 1) - if all or 'write' in dump: - autowaf.define(conf, 'SORD_DEBUG_WRITE', 1) + dump = Options.options.dump.split(',') + all = 'all' in dump + if all or 'iter' in dump: + autowaf.define(conf, 'SORD_DEBUG_ITER', 1) + if all or 'search' in dump: + autowaf.define(conf, 'SORD_DEBUG_SEARCH', 1) + if all or 'write' in dump: + autowaf.define(conf, 'SORD_DEBUG_WRITE', 1) - autowaf.define(conf, 'SORD_VERSION', SORD_VERSION) - conf.write_config_header('sord-config.h', remove=False) + autowaf.define(conf, 'SORD_VERSION', SORD_VERSION) + conf.write_config_header('sord-config.h', remove=False) - autowaf.display_msg(conf, "Utilities", str(conf.env['BUILD_UTILS'])) - autowaf.display_msg(conf, "Unit tests", str(conf.env['BUILD_TESTS'])) - autowaf.display_msg(conf, "Debug dumping", dump) - print('') + autowaf.display_msg(conf, "Utilities", str(conf.env['BUILD_UTILS'])) + autowaf.display_msg(conf, "Unit tests", str(conf.env['BUILD_TESTS'])) + autowaf.display_msg(conf, "Debug dumping", dump) + print('') def build(bld): - # C/C++ Headers - bld.install_files('${INCLUDEDIR}/sord', bld.path.ant_glob('sord/*.h')) - bld.install_files('${INCLUDEDIR}/sord', bld.path.ant_glob('sord/*.hpp')) - - # Pkgconfig file - autowaf.build_pc(bld, 'SORD', SORD_VERSION, []) - - # Library - obj = bld(features = 'c cshlib') - obj.source = 'src/sord.c src/syntax.c' - obj.includes = ['.', './src'] - obj.export_includes = ['.'] - obj.name = 'libsord' - obj.target = 'sord' - obj.vnum = SORD_LIB_VERSION - obj.install_path = '${LIBDIR}' - obj.cflags = [ '-fvisibility=hidden', '-DSORD_SHARED', '-DSORD_INTERNAL' ] - obj.libs = [ 'm' ] - autowaf.use_lib(bld, obj, 'GLIB SERD') - - if bld.env['BUILD_TESTS']: - # Static library (for unit test code coverage) - obj = bld(features = 'c cstlib') - obj.source = 'src/sord.c src/syntax.c' - obj.includes = ['.', './src'] - obj.name = 'libsord_static' - obj.target = 'sord_static' - obj.install_path = '' - obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ] - obj.libs = [ 'm' ] - autowaf.use_lib(bld, obj, 'GLIB SERD') - - # Unit test program - obj = bld(features = 'c cprogram') - obj.source = 'src/sord_test.c' - obj.includes = ['.', './src'] - obj.use = 'libsord_static' - obj.linkflags = '-lgcov' - obj.target = 'sord_test' - obj.install_path = '' - obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ] - autowaf.use_lib(bld, obj, 'GLIB SERD') - - # Unit test programa - if bld.env['BUILD_UTILS']: - obj = bld(features = 'c cprogram') - obj.source = 'src/sordi.c' - obj.includes = ['.', './src'] - obj.use = 'libsord_static' - obj.linkflags = '-lgcov' - obj.target = 'sordi_static' - obj.install_path = '' - obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ] - - # Documentation - autowaf.build_dox(bld, 'SORD', SORD_VERSION, top, out) - - bld.add_post_fun(autowaf.run_ldconfig) + # C/C++ Headers + bld.install_files('${INCLUDEDIR}/sord', bld.path.ant_glob('sord/*.h')) + bld.install_files('${INCLUDEDIR}/sord', bld.path.ant_glob('sord/*.hpp')) + + # Pkgconfig file + autowaf.build_pc(bld, 'SORD', SORD_VERSION, []) + + # Library + obj = bld(features = 'c cshlib') + obj.source = 'src/sord.c src/syntax.c' + obj.includes = ['.', './src'] + obj.export_includes = ['.'] + obj.name = 'libsord' + obj.target = 'sord' + obj.vnum = SORD_LIB_VERSION + obj.install_path = '${LIBDIR}' + obj.cflags = [ '-fvisibility=hidden', '-DSORD_SHARED', '-DSORD_INTERNAL' ] + obj.libs = [ 'm' ] + autowaf.use_lib(bld, obj, 'GLIB SERD') + + if bld.env['BUILD_TESTS']: + # Static library (for unit test code coverage) + obj = bld(features = 'c cstlib') + obj.source = 'src/sord.c src/syntax.c' + obj.includes = ['.', './src'] + obj.name = 'libsord_static' + obj.target = 'sord_static' + obj.install_path = '' + obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ] + obj.libs = [ 'm' ] + autowaf.use_lib(bld, obj, 'GLIB SERD') + + # Unit test program + obj = bld(features = 'c cprogram') + obj.source = 'src/sord_test.c' + obj.includes = ['.', './src'] + obj.use = 'libsord_static' + obj.linkflags = '-lgcov' + obj.target = 'sord_test' + obj.install_path = '' + obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ] + autowaf.use_lib(bld, obj, 'GLIB SERD') + + # Unit test programa + if bld.env['BUILD_UTILS']: + obj = bld(features = 'c cprogram') + obj.source = 'src/sordi.c' + obj.includes = ['.', './src'] + obj.use = 'libsord_static' + obj.linkflags = '-lgcov' + obj.target = 'sordi_static' + obj.install_path = '' + obj.cflags = [ '-fprofile-arcs', '-ftest-coverage' ] + + # Documentation + autowaf.build_dox(bld, 'SORD', SORD_VERSION, top, out) + + bld.add_post_fun(autowaf.run_ldconfig) def fix_docs(ctx): try: @@ -137,6 +137,6 @@ def upload_docs(ctx): os.system("rsync -avz --delete -e ssh build/doc/html/* drobilla@drobilla.net:~/drobilla.net/docs/sord") def test(ctx): - autowaf.pre_test(ctx, APPNAME) - autowaf.run_tests(ctx, APPNAME, ['./sord_test']) - autowaf.post_test(ctx, APPNAME) + autowaf.pre_test(ctx, APPNAME) + autowaf.run_tests(ctx, APPNAME, ['./sord_test']) + autowaf.post_test(ctx, APPNAME) |