Add -x32/-x64 suffix to boost libraries when building for Windows.
[dcpomatic.git] / cscript
diff --git a/cscript b/cscript
index 7fd6353432981f188258244f4f23bcc3f9a907df..7feb7eb036090bdadb0630583580a2ec78285eff 100644 (file)
--- a/cscript
+++ b/cscript
@@ -361,7 +361,7 @@ def make_spec(filename, version, target, options, requires=None):
     print('cd dcpomatic-%s' % version, file=f)
     print('export PKG_CONFIG_PATH=%s/lib/pkgconfig:%s/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig' % (target.directory, target.directory), file=f)
     print('CXXFLAGS="-I%s/include" LDFLAGS="-L%s/lib" ./waf configure --prefix=%%{buildroot}/usr --destdir=/usr %s' %
-          (target.directory, target.directory, configure_options(target, options)), file=f)
+          (target.directory, target.directory, configure_options(target, options, for_package=True)), file=f)
     print('./waf', file=f)
     print('%install', file=f)
     print('cd dcpomatic-%s' % version, file=f)
@@ -398,8 +398,8 @@ def dependencies(target, options):
         # Use distro-provided FFmpeg on Arch
         deps = []
 
-    deps.append(('libdcp', 'v1.8.7'))
-    deps.append(('libsub', 'v1.6.7'))
+    deps.append(('libdcp', 'v1.8.8'))
+    deps.append(('libsub', 'v1.6.8'))
     deps.append(('leqm-nrt', '93ae9e6'))
     deps.append(('rtaudio', 'f619b76'))
     # We get our OpenSSL libraries from the environment, but we
@@ -415,19 +415,21 @@ def dependencies(target, options):
 
 option_defaults = { "gui": True, "variant": None }
 
-def configure_options(target, options):
+def configure_options(target, options, for_package=False):
     opt = ' --warnings-are-errors'
 
-    if not ((target.platform == 'linux' and target.distro == 'ubuntu' and target.version == '18.04') or
+    if for_package or not (
+            (target.platform == 'linux' and target.distro == 'ubuntu' and target.version == '18.04') or
             (target.platform == 'osx') or
-            (target.platform == 'windows')):
+            (target.platform == 'windows')
+        ):
         # Currently we only build tests on Ubuntu 18.04, macOS and Windows
         opt += ' --disable-tests'
 
     if target.debug:
         opt += ' --enable-debug'
     if target.platform == 'windows':
-        opt += ' --target-windows'
+        opt += f' --target-windows-{target.bits}'
     elif target.platform == 'linux':
         opt += ' --static-dcpomatic --static-wxwidgets --static-ffmpeg --static-dcp --static-sub --static-cxml'
         if target.distro == 'centos':
@@ -570,7 +572,7 @@ def build(target, options, for_package):
             json.dump(desc, outfile)
         target.command('%s --repo=build/platform/repo build/platform/flatpak build/com.dcpomatic.DCP-o-matic.json' % target.flatpak_builder())
     elif target.platform != 'linux' or target.detail == 'appimage' or not for_package:
-        target.command('./waf configure --prefix=%s %s' % (target.directory, configure_options(target, options)))
+        target.command('./waf configure --prefix=%s %s' % (target.directory, configure_options(target, options, for_package)))
         target.command('./waf')
         target.command('./waf install')
 
@@ -615,7 +617,7 @@ def package_debian(target, cpu, version, options):
     target.set('CDIST_PKG_CONFIG_PATH', target.get('PKG_CONFIG_PATH'))
     target.set('CDIST_DIRECTORY', target.directory)
 
-    target.set('CDIST_CONFIGURE', '"' + configure_options(target, options) + '"')
+    target.set('CDIST_CONFIGURE', '"' + configure_options(target, options, for_package=True) + '"')
     target.set('CDIST_PACKAGE', f'dcpomatic{suffix}')
     if not target.debug:
         target.set('CDIST_DEBUG_PACKAGE_FLAG', '--no-ddebs')