diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-09-23 22:46:27 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-09-23 22:56:56 +0200 |
| commit | bb928b5f70520e8edc79c3af280bf1a3b55caf78 (patch) | |
| tree | c1d4cb82266efc1e0bcd7aac76d7689dbd442e55 | |
| parent | 5f090b58fc2a7742c3a924387416fa628f39477d (diff) | |
Build fixes for 32-bit Windows.v1.10.29
| -rw-r--r-- | src/pdf_formatter.cc | 3 | ||||
| -rw-r--r-- | src/wscript | 2 | ||||
| -rw-r--r-- | wscript | 26 |
3 files changed, 19 insertions, 12 deletions
diff --git a/src/pdf_formatter.cc b/src/pdf_formatter.cc index 5eb1772c..0ec77c4b 100644 --- a/src/pdf_formatter.cc +++ b/src/pdf_formatter.cc @@ -39,6 +39,9 @@ float constexpr vertical_margin = 1.0; static void +#ifdef LIBDCP_WINDOWS +__stdcall +#endif error_handler(HPDF_STATUS error, HPDF_STATUS detail, void*) { throw MiscError(fmt::format("Could not create PDF {} {}", error, detail)); diff --git a/src/wscript b/src/wscript index 6176ab53..3dc2ec12 100644 --- a/src/wscript +++ b/src/wscript @@ -263,7 +263,7 @@ def build(bld): """ - uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_DCPOMATIC XERCES AVCODEC AVUTIL FMT FAST_FLOAT' + uselib = 'BOOST_FILESYSTEM BOOST_SIGNALS2 BOOST_DATETIME OPENSSL SIGC++ LIBXML++ OPENJPEG CXML XMLSEC1 ASDCPLIB_DCPOMATIC XERCES AVCODEC AVUTIL FMT FAST_FLOAT HARU' if bld.env.LIBDCP_HAVE_HARU: source += "pdf_formatter.cc " @@ -271,17 +271,21 @@ def configure(conf): conf.check_cfg(package='fmt', args='--cflags --libs', uselib_store='FMT', mandatory=True) conf.check_cxx(header_name="fast_float/fast_float.h", uselib_store='FAST_FLOAT', mandatory=True) - haru = conf.check_cc(fragment=""" - #include "hpdf.h"\n - int main() { HPDF_Doc pdf; return 0; }\n - """, - msg='Checking for haru library', - libpath='/usr/local/lib', - lib=['hpdf'], - uselib_store='HARU', - define_name='LIBDCP_HAVE_HARU', - mandatory=False) - + # Windows has a .pc file, and we must use it to get an import cflag (HPDF_DLL) without which + # the 32-bit link fails + haru = conf.check_cfg(package='libharu', args='--cflags --libs', uselib_store='HARU', define_name='LIBDCP_HAVE_HARU', mandatory=False) + if not haru: + # Nobody else ships a .pc file + haru = conf.check_cc(fragment=""" + #include "hpdf.h"\n + int main() { HPDF_Doc pdf; return 0; }\n + """, + msg='Checking for haru library', + libpath='/usr/local/lib', + lib=['hpdf'], + uselib_store='HARU', + define_name='LIBDCP_HAVE_HARU', + mandatory=False) if haru: conf.env.append_value('LIBDCP_HAVE_HARU', '1') |
