Add -x32/-x64 suffix to boost libraries when building for Windows. v1.8.8
authorCarl Hetherington <cth@carlh.net>
Tue, 22 Feb 2022 21:56:48 +0000 (22:56 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 25 Feb 2022 13:50:27 +0000 (14:50 +0100)
cscript
test/wscript
wscript

diff --git a/cscript b/cscript
index 5a2da6d1d03a419ce8f13407475db5ed3de06d54..e283fb344eeb70d54ecc0f63dd2b321909d7fea1 100644 (file)
--- a/cscript
+++ b/cscript
@@ -1,5 +1,5 @@
 #
-#    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
+#    Copyright (C) 2012-2022 Carl Hetherington <cth@carlh.net>
 #
 #    This file is part of libdcp.
 #
@@ -37,11 +37,11 @@ import shutil
 option_defaults = { 'jpeg': 'oj2' }
 
 def dependencies(target, options):
-    libcxml = ('libcxml', 'v0.17.2')
+    libcxml = ('libcxml', 'v0.17.3')
     if options['jpeg'] == 'oj1':
-        return (libcxml, ('openjpeg', 'f166257'), ('asdcplib', 'bb09615'))
+        return (libcxml, ('openjpeg', 'f166257'), ('asdcplib', '97918d86caf4b5a2296a0d3092f1e2e69b9af9e5'))
     else:
-        return (libcxml, ('openjpeg', 'a1403c2'), ('asdcplib', 'bb09615'))
+        return (libcxml, ('openjpeg', 'a1403c2'), ('asdcplib', '97918d86caf4b5a2296a0d3092f1e2e69b9af9e5'))
 
 def build(target, options):
     cmd = './waf configure --disable-examples --disable-benchmarks --prefix=%s' % target.directory
@@ -52,7 +52,7 @@ def build(target, options):
             # We only build tests on Ubuntu 18.04
             cmd += ' --disable-tests'
     elif target.platform == 'windows':
-        cmd += ' --target-windows --disable-gcov --disable-tests'
+        cmd += f' --target-windows-{target.bits} --disable-gcov --disable-tests'
         if target.version == 'xp':
             # OpenJPEG 1.x is inexplicably faster on Windows XP; see DCP-o-matic bug #771
             cmd += ' --jpeg=oj1'
index 29b3e487a76dfbd365b1e1a36e481aa6096e50bf..62d258bf016d9457ea0ce8797910b5be455e93e7 100644 (file)
 #
 
 def configure(conf):
-    if conf.options.target_windows:
-        boost_lib_suffix = '-mt'
+    if conf.options.target_windows_64:
+        boost_lib_suffix = '-mt-x64'
+    elif conf.options.target_windows_32:
+        boost_lib_suffix = '-mt-x32'
     else:
         boost_lib_suffix = ''
 
diff --git a/wscript b/wscript
index eee10843e0bcadfc3b6915bbd7f1fb01b49a81b8..71733e99ee1a4bd5b35935baee0176df57d4a2d1 100644 (file)
--- a/wscript
+++ b/wscript
@@ -1,5 +1,5 @@
 #
-#    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+#    Copyright (C) 2012-2022 Carl Hetherington <cth@carlh.net>
 #
 #    This file is part of libdcp.
 #
@@ -52,7 +52,8 @@ API_VERSION = '-1.0'
 
 def options(opt):
     opt.load('compiler_cxx')
-    opt.add_option('--target-windows', action='store_true', default=False, help='set up to do a cross-compile to Windows')
+    opt.add_option('--target-windows-64', action='store_true', default=False, help='set up to do a cross-compile to Windows 64-bit')
+    opt.add_option('--target-windows-32', action='store_true', default=False, help='set up to do a cross-compile to Windows 32-bit')
     opt.add_option('--enable-debug', action='store_true', default=False, help='build with debugging information and without optimisation')
     opt.add_option('--static', action='store_true', default=False, help='build libdcp statically, and link statically to openjpeg, cxml, asdcplib-carl')
     opt.add_option('--disable-tests', action='store_true', default=False, help='disable building of tests')
@@ -72,7 +73,8 @@ def configure(conf):
         conf.env.append_value('CXXFLAGS', ['-Wno-maybe-uninitialized'])
     conf.env.append_value('CXXFLAGS', ['-DLIBDCP_VERSION="%s"' % VERSION])
 
-    conf.env.TARGET_WINDOWS = conf.options.target_windows
+    conf.env.TARGET_WINDOWS_64 = conf.options.target_windows_64
+    conf.env.TARGET_WINDOWS_32 = conf.options.target_windows_32
     conf.env.TARGET_OSX = sys.platform == 'darwin'
     conf.env.TARGET_LINUX = not conf.env.TARGET_WINDOWS and not conf.env.TARGET_OSX
     conf.env.ENABLE_DEBUG = conf.options.enable_debug
@@ -82,7 +84,7 @@ def configure(conf):
     conf.env.STATIC = conf.options.static
     conf.env.API_VERSION = API_VERSION
 
-    if conf.env.TARGET_WINDOWS:
+    if conf.env.TARGET_WINDOWS_64 or conf.env.TARGET_WINDOWS_32:
         conf.env.append_value('CXXFLAGS', '-DLIBDCP_WINDOWS')
     if conf.env.TARGET_OSX:
         conf.env.append_value('CXXFLAGS', '-DLIBDCP_OSX')
@@ -104,7 +106,7 @@ def configure(conf):
         conf.env.append_value('LDFLAGS', ['-l%s' % conf.options.openmp])
         conf.check_cxx(cxxflags='-fopenmp', msg='Checking that compiler supports -fopenmp')
 
-    if not conf.env.TARGET_WINDOWS:
+    if not conf.env.TARGET_WINDOWS_64 and not conf.env.TARGET_WINDOWS_32:
         conf.env.append_value('LINKFLAGS', '-pthread')
 
     if conf.env.TARGET_LINUX:
@@ -159,13 +161,15 @@ def configure(conf):
         conf.check_cfg(package='libcxml', atleast_version='0.17.0', args='--cflags --libs', uselib_store='CXML', mandatory=True)
         conf.check_cfg(package='xerces-c', args='--cflags --libs', uselib_store='XERCES', mandatory=True)
 
-    if conf.options.target_windows:
+    if conf.env.TARGET_WINDOWS_64 or conf.env.TARGET_WINDOWS_32:
         # XXX: it feels like there should be a more elegant way to get these included
         conf.env.LIB_XERCES.append('curl')
         conf.env.LIB_XERCES.append('ws2_32')
 
-    if conf.options.target_windows:
-        boost_lib_suffix = '-mt'
+    if conf.options.target_windows_64:
+        boost_lib_suffix = '-mt-x64'
+    elif conf.options.target_windows_32:
+        boost_lib_suffix = '-mt-x32'
     else:
         boost_lib_suffix = ''
 
@@ -226,8 +230,10 @@ def configure(conf):
 def build(bld):
     create_version_cc(bld, VERSION)
 
-    if bld.env.TARGET_WINDOWS:
-        boost_lib_suffix = '-mt'
+    if bld.env.TARGET_WINDOWS_64:
+        boost_lib_suffix = '-mt-x64'
+    elif bld.env.TARGET_WINDOWS_32:
+        boost_lib_suffix = '-mt-x32'
     else:
         boost_lib_suffix = ''