From 8aa97c043d73e0c6c8bc484a307b944702c7d3dd Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 17 Mar 2021 11:12:14 +0100 Subject: [PATCH] Require boost 1.61.0 or above on Windows/macOS. --- src/lib/cross_osx.cc | 12 ------------ wscript | 14 +++++++++----- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index 6c00afb97..fc8ccd4a8 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -99,19 +99,7 @@ cpu_info () boost::filesystem::path directory_containing_executable () { -#if BOOST_VERSION >= 106100 return boost::dll::program_location().parent_path(); -#else - uint32_t size = 1024; - char buffer[size]; - if (_NSGetExecutablePath (buffer, &size)) { - throw runtime_error ("_NSGetExecutablePath failed"); - } - - boost::filesystem::path path (buffer); - path = boost::filesystem::canonical (path); - return path.parent_path (); -#endif } diff --git a/wscript b/wscript index 016feaa66..4b3164f71 100644 --- a/wscript +++ b/wscript @@ -1,5 +1,5 @@ # -# Copyright (C) 2012-2019 Carl Hetherington +# Copyright (C) 2012-2021 Carl Hetherington # # This file is part of DCP-o-matic. # @@ -476,6 +476,10 @@ def configure(conf): if conf.env.TARGET_LINUX: conf.env.LIB_X11 = ['X11'] + # We support older boosts on Linux so we can use the distribution-provided package + # on Centos 7, but it's good if we can use 1.61 for boost::dll::program_location() + boost_version = ('1.45', '104500') if conf.env.TARGET_LINUX else ('1.61', '106800') + # Boost if conf.options.static_boost: conf.env.STLIB_BOOST_THREAD = ['boost_thread'] @@ -487,15 +491,15 @@ def configure(conf): else: conf.check_cxx(fragment=""" #include \n - #if BOOST_VERSION < 104500\n + #if BOOST_VERSION < %s\n #error boost too old\n #endif\n int main(void) { return 0; }\n - """, + """ % boost_version[1], mandatory=True, - msg='Checking for boost library >= 1.45', + msg='Checking for boost library >= %s' % boost_version[0], okmsg='yes', - errmsg='too old\nPlease install boost version 1.45 or higher.') + errmsg='too old\nPlease install boost version %s or higher.' % boost_version[0]) conf.check_cxx(fragment=""" #include \n -- 2.30.2