summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-09-03 20:10:21 +0200
committerCarl Hetherington <cth@carlh.net>2024-09-04 01:01:35 +0200
commit844c7cf3bbf9c1607b329a00bbffc3ea86a0ddab (patch)
tree4d0b7737159f084dd4f0edd0b5a64d1d327caae0
parent5defe5065789beeb903bcf65de05dd4468079ea7 (diff)
Cater for static boost properly and note that Ubuntu 16.04 uses it.v0.17.10
-rw-r--r--cscript6
-rw-r--r--test/tests.cc1
-rw-r--r--wscript6
3 files changed, 7 insertions, 6 deletions
diff --git a/cscript b/cscript
index 3104602..728c45a 100644
--- a/cscript
+++ b/cscript
@@ -24,10 +24,8 @@ def build(target, options):
cmd = './waf configure --prefix=%s' % target.directory
if target.platform == 'linux':
cmd += ' --static'
- if target.distro == 'centos':
- # Centos builds using static boost, which means tests don't
- # build as test/tests.cc defines BOOST_TEST_DYN_LINK
- cmd += ' --disable-tests'
+ if target.distro == 'centos' or (target.distro == 'ubuntu' and target.version == '16.04'):
+ cmd += ' --static-boost'
elif target.platform == 'windows':
cmd += f' --target-windows-{target.bits}'
diff --git a/test/tests.cc b/test/tests.cc
index 4b8efc7..af84962 100644
--- a/test/tests.cc
+++ b/test/tests.cc
@@ -23,7 +23,6 @@
#include <libxml++/libxml++.h>
#include "cxml.h"
-#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE libcxml_test
#include <boost/test/unit_test.hpp>
diff --git a/wscript b/wscript
index b71f4f6..4cc7382 100644
--- a/wscript
+++ b/wscript
@@ -40,6 +40,7 @@ def options(opt):
opt.add_option('--target-windows-32', action='store_true', default=False, help='set up to do a cross-compile to Windows 32-bit')
opt.add_option('--enable-debug', action='store_true', default=False, help='build with debugging information and without optimisation')
opt.add_option('--static', action='store_true', default=False, help='build statically')
+ opt.add_option('--static-boost', action='store_true', default=False, help='link statically against boost')
opt.add_option('--disable-tests', action='store_true', default=False, help='disable building of tests')
opt.add_option('--c++17', action='store_true', default=False, help='build with C++17 and libxml++-4.0')
@@ -71,6 +72,9 @@ def configure(conf):
boost_lib_suffix = ''
conf.env.append_value('CXXFLAGS', '-DLIBCXML_POSIX')
+ if not conf.options.static_boost:
+ conf.env.append_value('CXXFLAGS', '-DBOOST_TEST_DYN_LINK')
+
conf.check_cfg(package='libxml++-' + conf.env.XMLPP_API, args='--cflags --libs', uselib_store='LIBXML++', mandatory=True)
conf.check_cxx(fragment="""
@@ -86,7 +90,7 @@ def configure(conf):
conf.check_cxx(fragment="""
#define BOOST_TEST_MODULE Config test\n
#include <boost/test/unit_test.hpp>\n
- int main() {}
+ BOOST_AUTO_TEST_CASE(foo) {}
""",
msg='Checking for boost unit testing library',
lib=['boost_unit_test_framework%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix],