diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-02-22 23:06:29 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-02-24 21:13:14 +0100 |
| commit | 02d8f881481dae127d5e85094d5059666a13a35d (patch) | |
| tree | ce2bfbcdc3feebaaba752a1ccfbcbd8702cf3d4d /wscript | |
| parent | 8f23c6c904d17e468bf94397fee28e1242cb1651 (diff) | |
Add -x32/-x64 suffix to boost libraries when building for Windows.
Diffstat (limited to 'wscript')
| -rw-r--r-- | wscript | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -21,7 +21,8 @@ else: 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 statically') @@ -29,9 +30,10 @@ def configure(conf): conf.load('compiler_cxx') conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-D_FILE_OFFSET_BITS=64', '-D__STDC_FORMAT_MACROS']) - 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.TARGET_LINUX = not conf.env.TARGET_WINDOWS_64 and not conf.env.TARGET_WINDOWS_32 and not conf.env.TARGET_OSX conf.env.STATIC = conf.options.static conf.env.VERSION = VERSION @@ -44,8 +46,10 @@ def configure(conf): conf.check_cfg(package='openssl', args='--cflags --libs', uselib_store='OPENSSL', mandatory=True) - 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 = '' @@ -80,8 +84,11 @@ def configure(conf): conf.recurse('src') def build(bld): - if bld.env.TARGET_WINDOWS: - boost_lib_suffix = '-mt' + if bld.env.TARGET_WINDOWS_64: + boost_lib_suffix = '-mt-x64' + flags = '-DKM_WIN32 -DWIN32_LEAN_AND_MEAN' + elif bld.env.TARGET_WINDOWS_32: + boost_lib_suffix = '-mt-x32' flags = '-DKM_WIN32 -DWIN32_LEAN_AND_MEAN' else: boost_lib_suffix = '' |
