From 8ea5536b421796114ee8d0ba02ced1f9ea2e7c58 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 8 Oct 2018 22:27:54 +0300 Subject: [PATCH] wscript: fix win32 build --- engine/wscript | 13 ++++++++++++- game_launch/wscript | 3 ++- mainui | 2 +- vgui_support/wscript | 4 +++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/engine/wscript b/engine/wscript index 4be3ff93..a05bf2c7 100644 --- a/engine/wscript +++ b/engine/wscript @@ -8,6 +8,9 @@ import os top = '.' def options(opt): + opt.add_option( + '--sdl2', action='store', type='string', dest = 'SDL2_PATH', default = None, + help = 'SDL2 path to build(required for Windows)') opt.add_option( '--enable-bsp2', action = 'store_true', dest = 'SUPPORT_BSP2_FORMAT', default = False, help = 'build engine with BSP2 map support(recommended for Quake, breaks compability!)') @@ -29,7 +32,15 @@ def configure(conf): msg='Checking for SDL2', uselib_store='SDL2') except conf.errors.ConfigurationError: - conf.fatal('SDL2 not availiable! If you want to build dedicated server, specify --dedicated') + if(conf.options.SDL2_PATH): + conf.start_msg('Configuring SDL2 by provided path') + conf.env.HAVE_SDL2 = 1 + conf.env.INCLUDES_SDL2 = [os.path.abspath(os.path.join(conf.options.SDL2_PATH, 'include'))] + conf.env.LIBPATH_SDL2 = [os.path.abspath(os.path.join(conf.options.SDL2_PATH, 'lib/x86'))] + conf.env.LIB_SDL2 = ['SDL2'] + conf.end_msg('ok') + else: + conf.fatal('SDL2 not availiable! If you want to build dedicated server, specify --dedicated') conf.env.append_unique('DEFINES', 'XASH_SDL') if(conf.options.SUPPORT_BSP2_FORMAT): diff --git a/game_launch/wscript b/game_launch/wscript index 9983dea6..db762e4d 100644 --- a/game_launch/wscript +++ b/game_launch/wscript @@ -31,6 +31,7 @@ def configure(conf): conf.env.append_unique('DEFINES', 'XASH_SDL') else: conf.check(lib='USER32') + conf.check(lib='SHELL32') def get_subproject_name(ctx): return os.path.basename(os.path.realpath(str(ctx.path))) @@ -53,7 +54,7 @@ def build(bld): else: # compile resource on Windows bld.load('winres') - libs += ['USER32'] + libs += ['USER32', 'SHELL32'] source += ['game.rc'] bld( diff --git a/mainui b/mainui index 0f8b8d80..c8f22ee6 160000 --- a/mainui +++ b/mainui @@ -1 +1 @@ -Subproject commit 0f8b8d809a8406757cebb72077d608e512f7d9db +Subproject commit c8f22ee638d6009db1998e72956ddae26fa39724 diff --git a/vgui_support/wscript b/vgui_support/wscript index 21f12af4..c88f4619 100644 --- a/vgui_support/wscript +++ b/vgui_support/wscript @@ -34,7 +34,7 @@ def configure(conf): conf.fatal('vgui is not supported on this CPU: ' + conf.env.DEST_CPU) if conf.env.DEST_OS == 'win32': - conf.env.LIB_VGUI = ['vgui.lib'] + conf.env.LIB_VGUI = ['vgui'] conf.env.LIBPATH_VGUI = [os.path.abspath(os.path.join(conf.options.VGUI_DEV, 'lib/win32_vc6/'))] else: if conf.env.DEST_OS == 'linux': @@ -59,6 +59,8 @@ def build(bld): if bld.env.DEDICATED or bld.env.NO_VGUI: return + libs = [] + # basic build: dedicated only, no dependencies if bld.env.DEST_OS != 'win32': libs = [ 'DL', 'M' ]