2 # Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
4 # This file is part of libsub.
6 # libsub is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # libsub is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with libsub. If not, see <http://www.gnu.org/licenses/>.
22 def dependencies(target):
23 return (('asdcplib-cth', '6648afc'), ('libcxml', '670c528'), ('libdcp', '097f27f'))
25 def build(target, options):
26 cmd = './waf configure --prefix=%s' % target.directory
27 if target.platform == 'linux':
29 if target.distro == 'centos':
30 cmd += ' --disable-tests'
31 if target.version == '7':
32 # Centos 7 ships with glibmm 2.50.0 which requires C++11
33 # but its compiler (gcc 4.8.5) defaults to C++97. Go figure.
34 # I worry that this will cause ABI problems but I don't have
36 cmd += ' --force-cpp11'
37 if target.distro == 'mageia' and target.version == '6':
38 # Mageia 6 pulls the same stunt except it's libxml++ that requires C++11
39 cmd += ' --force-cpp11'
41 cmd += ' --enable-debug'
42 if target.platform == 'windows':
43 cmd += ' --target-windows --disable-tests'
46 target.command('./waf build install')
48 def make_doxygen(target):
49 os.makedirs('build/doc')
50 target.command('doxygen')
51 return os.path.abspath('build/doc/html')
53 def test(target, test):
54 if target.platform != 'windows':
55 target.set('LC_ALL', 'C')
57 target.command('run/tests')
59 target.command('run/tests --run_test=%s' % test)