Require boost 1.61.0 or above on Windows/macOS.
authorCarl Hetherington <cth@carlh.net>
Wed, 17 Mar 2021 10:12:14 +0000 (11:12 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 18 Mar 2021 08:48:27 +0000 (09:48 +0100)
src/lib/cross_osx.cc
wscript

index 6c00afb973bf442b60073f3d94a20e278837ecdf..fc8ccd4a872dbe2566324d877d053e5beaa80637 100644 (file)
@@ -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 016feaa66c22fa5473dd5b8425333f3e61cf16dc..4b3164f71e16d6101133c96c504a0318f630eb54 100644 (file)
--- a/wscript
+++ b/wscript
@@ -1,5 +1,5 @@
 #
-#    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
+#    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 #
 #    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 <boost/version.hpp>\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 <boost/thread.hpp>\n