diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-09-03 21:42:13 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-09-04 01:07:33 +0200 |
| commit | a782f96fe18d3031f07705be602c186f23c51aee (patch) | |
| tree | 93b790a56b81ef8b9f41e9f421ae46c46046314e | |
| parent | 52a482ef5d0ed791d7e9a0a30c143a8e3012023a (diff) | |
Handle static link with boost better, and extend it to Ubuntu 16.04.v1.6.50
| -rw-r--r-- | cscript | 4 | ||||
| -rw-r--r-- | test/test.cc | 3 | ||||
| -rw-r--r-- | test/wscript | 4 | ||||
| -rw-r--r-- | wscript | 4 |
4 files changed, 10 insertions, 5 deletions
@@ -25,8 +25,8 @@ def build(target, options): cmd = './waf configure --prefix=%s' % target.directory if target.platform == 'linux': cmd += ' --static' - if target.distro == 'centos': - cmd += ' --disable-tests' + if target.distro == 'centos' or (target.distro == 'ubuntu' and target.version == '16.04'): + cmd += ' --static-boost' if target.debug: cmd += ' --enable-debug' if target.platform == 'windows': diff --git a/test/test.cc b/test/test.cc index bc2acda..10d31f9 100644 --- a/test/test.cc +++ b/test/test.cc @@ -17,8 +17,9 @@ */ -#define BOOST_TEST_DYN_LINK + #define BOOST_TEST_MODULE libsub_test + #include "iso6937_tables.h" #include "compose.hpp" #include <boost/test/unit_test.hpp> diff --git a/test/wscript b/test/wscript index 348b138..c6a01b0 100644 --- a/test/wscript +++ b/test/wscript @@ -5,8 +5,8 @@ def configure(conf): conf.check_cxx(fragment=""" #define BOOST_TEST_MODULE Config test\n - #include <boost/test/unit_test.hpp>\n - int main() {} + #include <boost/test/unit_test.hpp>\n + BOOST_AUTO_TEST_CASE(foo) {} """, msg='Checking for boost unit testing library', lib='boost_unit_test_framework%s' % boost_lib_suffix, @@ -76,6 +76,7 @@ def options(opt): opt.load('compiler_cxx') 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 libsub statically') + opt.add_option('--static-boost', action='store_true', default=False, help='link statically to boost') opt.add_option('--target-windows-64', action='store_true', default=False, help='set up to do a cross-compile to make a Windows package 64-bit') opt.add_option('--target-windows-32', action='store_true', default=False, help='set up to do a cross-compile to make a Windows package 32-bit') opt.add_option('--disable-tests', action='store_true', default=False, help='disable building of tests') @@ -109,6 +110,9 @@ def configure(conf): # Disable libxml++ deprecation warnings for now conf.env.append_value('CXXFLAGS', ['-Wno-deprecated-declarations']) + if not conf.options.static_boost: + conf.env.append_value('CXXFLAGS', '-DBOOST_TEST_DYN_LINK') + conf.check_cfg(package='openssl', args='--cflags --libs', uselib_store='OPENSSL', mandatory=True) boost_lib_suffix = '' |
