Remove debug code.
[libcxml.git] / wscript
1 APPNAME = 'libcxml'
2 VERSION = '0.12.0devel'
3 API_VERSION = '0.0.0'
4
5 def options(opt):
6     opt.load('compiler_cxx')
7     opt.add_option('--target-windows', action='store_true', default=False, help='set up to do a cross-compile to Windows')
8     opt.add_option('--static', action='store_true', default=False, help='build statically')
9     opt.add_option('--disable-tests', action='store_true', default=False, help='disable building of tests')
10
11 def configure(conf):
12     conf.load('compiler_cxx')
13     conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-O2'])
14
15     conf.env.TARGET_WINDOWS = conf.options.target_windows
16     conf.env.STATIC = conf.options.static
17     conf.env.DISABLE_TESTS = conf.options.disable_tests
18     conf.env.API_VERSION = API_VERSION
19
20     if conf.options.target_windows:
21         boost_lib_suffix = '-mt'
22     else:
23         boost_lib_suffix = ''
24
25     conf.check_cfg(package='libxml++-2.6', args='--cflags --libs', uselib_store='LIBXML++', mandatory=True)
26
27     conf.check_cxx(fragment="""
28                    #include <boost/filesystem.hpp>\n
29                    int main() { boost::filesystem::copy_file ("a", "b"); }\n
30                    """,
31                    msg='Checking for boost filesystem library',
32                    libpath='/usr/local/lib',
33                    lib=['boost_filesystem%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix],
34                    uselib_store='BOOST_FILESYSTEM')
35
36     if not conf.options.disable_tests:
37         conf.check_cxx(fragment="""
38                                   #define BOOST_TEST_MODULE Config test\n
39                                   #include <boost/test/unit_test.hpp>\n
40                                   int main() {}
41                                   """,
42                                   msg='Checking for boost unit testing library',
43                                   lib=['boost_unit_test_framework%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix],
44                                   uselib_store='BOOST_TEST')
45
46         conf.recurse('test')
47
48 def build(bld):
49
50     bld(source='libcxml.pc.in',
51         version=VERSION,
52         includedir='%s/include' % bld.env.PREFIX,
53         libs="-L${libdir} -lcxml",
54         install_path='${LIBDIR}/pkgconfig')
55
56     bld.recurse('src')
57     if not bld.env.DISABLE_TESTS:
58         bld.recurse('test')