From 3c8e87575da3795aa31ed9653da72abb8ed88996 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 21 Sep 2024 23:04:32 +0200 Subject: Remove unused references to boost::signals2. --- wscript | 7 ------- 1 file changed, 7 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index 062e54da..76fc166c 100644 --- a/wscript +++ b/wscript @@ -227,13 +227,6 @@ def configure(conf): uselib='BOOST_FILESYSTEM', define_name='LIBDCP_HAVE_WEAKLY_CANONICAL') - conf.check_cxx(fragment=""" - #include \n - int main() { boost::signals2::signal x; }\n - """, - msg='Checking for boost signals2 library', - uselib_store='BOOST_SIGNALS2') - conf.check_cxx(fragment=""" #include \n int main() { boost::gregorian::day_clock::local_day(); }\n -- cgit v1.2.3 From 6fba38bd59450e167e664153a31f41e97a500ffc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 21 Sep 2024 23:06:58 +0200 Subject: Support new boost versions (DoM #2867). --- src/filesystem.cc | 6 +++++- src/filesystem.h | 4 ++++ wscript | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'wscript') diff --git a/src/filesystem.cc b/src/filesystem.cc index 83c55ab0..bdd15039 100644 --- a/src/filesystem.cc +++ b/src/filesystem.cc @@ -107,7 +107,11 @@ dcp::filesystem::copy_file(boost::filesystem::path const& from, boost::filesyste void +#ifdef LIBDCP_HAVE_COPY_OPTIONS +dcp::filesystem::copy_file(boost::filesystem::path const& from, boost::filesystem::path const& to, boost::filesystem::copy_options option) +#else dcp::filesystem::copy_file(boost::filesystem::path const& from, boost::filesystem::path const& to, boost::filesystem::copy_option option) +#endif { boost::filesystem::copy_file(dcp::filesystem::fix_long_path(from), dcp::filesystem::fix_long_path(to), option); } @@ -247,7 +251,7 @@ dcp::filesystem::create_symlink(boost::filesystem::path const& from, boost::file std::string dcp::filesystem::extension(boost::filesystem::path const& path) { - return boost::filesystem::extension(dcp::filesystem::fix_long_path(path)); + return dcp::filesystem::fix_long_path(path).extension().string(); } diff --git a/src/filesystem.h b/src/filesystem.h index 30da1c3b..1d434200 100644 --- a/src/filesystem.h +++ b/src/filesystem.h @@ -50,7 +50,11 @@ boost::filesystem::path weakly_canonical(boost::filesystem::path const& path); void copy(boost::filesystem::path const& from, boost::filesystem::path const& to); void copy_file(boost::filesystem::path const& from, boost::filesystem::path const& to); void copy_file(boost::filesystem::path const& from, boost::filesystem::path const& to, boost::system::error_code& ec); +#ifdef LIBDCP_HAVE_COPY_OPTIONS +void copy_file(boost::filesystem::path const& from, boost::filesystem::path const& to, boost::filesystem::copy_options ec); +#else void copy_file(boost::filesystem::path const& from, boost::filesystem::path const& to, boost::filesystem::copy_option ec); +#endif bool create_directory(boost::filesystem::path const& path); bool create_directory(boost::filesystem::path const& path, boost::system::error_code& ec); bool create_directories(boost::filesystem::path const& path); diff --git a/wscript b/wscript index 76fc166c..77cfa11f 100644 --- a/wscript +++ b/wscript @@ -227,6 +227,15 @@ def configure(conf): uselib='BOOST_FILESYSTEM', define_name='LIBDCP_HAVE_WEAKLY_CANONICAL') + conf.check_cxx(fragment=""" + #include \n + int main() { auto x = boost::filesystem::copy_options(); }\n + """, + mandatory=False, + msg='Checking for boost::filesystem::copy_options', + uselib='BOOST_FILESYSTEM', + define_name='LIBDCP_HAVE_COPY_OPTIONS') + conf.check_cxx(fragment=""" #include \n int main() { boost::gregorian::day_clock::local_day(); }\n -- cgit v1.2.3 From 466a21fbf04f9b5ee1bcddc0f9cee6c454799006 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 23 Sep 2024 21:13:57 +0200 Subject: Another fix for new boost. --- src/filesystem.cc | 6 ++++++ wscript | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'wscript') diff --git a/src/filesystem.cc b/src/filesystem.cc index cb38ddfe..98c3d1b7 100644 --- a/src/filesystem.cc +++ b/src/filesystem.cc @@ -301,7 +301,13 @@ dcp::filesystem::rename(boost::filesystem::path const& old_path, boost::filesyst boost::filesystem::path dcp::filesystem::change_extension(boost::filesystem::path const& path, std::string const& new_extension) { +#ifdef LIBDCP_HAVE_REPLACE_EXTENSION + auto copy = path; + copy.replace_extension(new_extension); + return copy; +#else return boost::filesystem::change_extension(path, new_extension); +#endif } diff --git a/wscript b/wscript index 77cfa11f..a45a72a4 100644 --- a/wscript +++ b/wscript @@ -236,6 +236,15 @@ def configure(conf): uselib='BOOST_FILESYSTEM', define_name='LIBDCP_HAVE_COPY_OPTIONS') + conf.check_cxx(fragment=""" + #include \n + int main() { boost::filesystem::path y = "foo"; y.replace_extension("bar"); }\n + """, + mandatory=False, + msg='Checking for boost::filesystem::replace_extension', + uselib='BOOST_FILESYSTEM', + define_name='LIBDCP_HAVE_REPLACE_EXTENSION') + conf.check_cxx(fragment=""" #include \n int main() { boost::gregorian::day_clock::local_day(); }\n -- cgit v1.2.3