From ddccef68ae80bac6b4aa8583dd8e0a7c943b535c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 7 Apr 2020 01:29:50 +0200 Subject: [PATCH] Add DCPOMATIC_DISK define and don't build stuff needing boost dll library if we don't need it. --- src/lib/cross.h | 2 ++ src/lib/cross_linux.cc | 4 ++++ src/lib/cross_osx.cc | 2 ++ src/lib/cross_windows.cc | 2 ++ wscript | 5 ++++- 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/lib/cross.h b/src/lib/cross.h index 20bab38a2..6d3c2bd2e 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -45,7 +45,9 @@ extern std::string cpu_info (); extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path); extern std::list > mount_info (); extern boost::filesystem::path openssl_path (); +#ifdef DCPOMATIC_DISK extern boost::filesystem::path disk_writer_path (); +#endif #ifdef DCPOMATIC_OSX extern boost::filesystem::path app_contents (); #endif diff --git a/src/lib/cross_linux.cc b/src/lib/cross_linux.cc index 406087917..8c81c5008 100644 --- a/src/lib/cross_linux.cc +++ b/src/lib/cross_linux.cc @@ -31,7 +31,9 @@ extern "C" { } #include #include +#ifdef DCPOMATIC_DISK #include +#endif #include #include #include @@ -140,11 +142,13 @@ openssl_path () return "dcpomatic2_openssl"; } +#ifdef DCPOMATIC_DISK boost::filesystem::path disk_writer_path () { return boost::dll::program_location().parent_path() / "dcpomatic2_disk_writer"; } +#endif /* Apparently there is no way to create an ofstream using a UTF-8 filename under Windows. We are hence reduced to using fopen diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index fa12fb380..481edad0d 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -131,6 +131,7 @@ openssl_path () return path; } +#ifdef DCPOMATIC_DISK boost::filesystem::path disk_writer_path () { @@ -139,6 +140,7 @@ disk_writer_path () path /= "dcpomatic2_disk_writer"; return path; } +#endif /* Apparently there is no way to create an ofstream using a UTF-8 filename under Windows. We are hence reduced to using fopen diff --git a/src/lib/cross_windows.cc b/src/lib/cross_windows.cc index 130086898..f55e0a9c2 100644 --- a/src/lib/cross_windows.cc +++ b/src/lib/cross_windows.cc @@ -198,11 +198,13 @@ openssl_path () return executable_path() / "openssl.exe"; } +#ifdef DCPOMATIC_DISK boost::filesystem::path disk_writer_path () { return executable_path() / "dcpomatic2_disk_writer.exe"; } +#endif /* Apparently there is no way to create an ofstream using a UTF-8 filename under Windows. We are hence reduced to using fopen diff --git a/wscript b/wscript index a94fee8ba..c386ed21d 100644 --- a/wscript +++ b/wscript @@ -74,7 +74,7 @@ def options(opt): opt.add_option('--force-cpp11', action='store_true', default=False, help='force use of C++11') opt.add_option('--variant', help='build variant (swaroop-studio, swaroop-theater)', choices=['swaroop-studio', 'swaroop-theater']) opt.add_option('--use-lld', action='store_true', default=False, help='use lld linker') - opt.add_option('--enable-disk', action='store_true', default=False, help='build dcpomatic2_disk tool; requires Boost process and lwext4 libraries') + opt.add_option('--enable-disk', action='store_true', default=False, help='build dcpomatic2_disk tool; requires Boost process, lwext4 and nanomsg libraries') def configure(conf): conf.load('compiler_cxx') @@ -135,6 +135,9 @@ def configure(conf): if conf.options.variant.startswith('swaroop-'): conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_VARIANT_SWAROOP') + if conf.options.enable_disk: + conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_DISK') + if conf.options.use_lld: try: conf.find_program('ld.lld') -- 2.30.2