mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-20 03:50:08 +00:00
wscript: allow to setup engine default gamedir during configure
This commit is contained in:
parent
686a966ff7
commit
f571a41cf3
@ -35,7 +35,9 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define E_GAME "XASH3D_GAME" // default env dir to start from
|
#define E_GAME "XASH3D_GAME" // default env dir to start from
|
||||||
#define GAME_PATH "valve" // default dir to start from
|
#ifndef XASH_GAMEDIR
|
||||||
|
#define XASH_GAMEDIR "valve"
|
||||||
|
#endif
|
||||||
|
|
||||||
static char szGameDir[128]; // safe place to keep gamedir
|
static char szGameDir[128]; // safe place to keep gamedir
|
||||||
static int szArgc;
|
static int szArgc;
|
||||||
@ -56,7 +58,7 @@ _inline int Sys_Start( void )
|
|||||||
const char *game = getenv( E_GAME );
|
const char *game = getenv( E_GAME );
|
||||||
|
|
||||||
if( !game )
|
if( !game )
|
||||||
game = GAME_PATH;
|
game = XASH_GAMEDIR;
|
||||||
|
|
||||||
Q_strncpy( szGameDir, game, sizeof( szGameDir ));
|
Q_strncpy( szGameDir, game, sizeof( szGameDir ));
|
||||||
#if XASH_EMSCRIPTEN
|
#if XASH_EMSCRIPTEN
|
||||||
|
@ -45,7 +45,9 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define E_GAME "XASH3D_GAME" // default env dir to start from
|
#define E_GAME "XASH3D_GAME" // default env dir to start from
|
||||||
#define GAME_PATH "valve" // default dir to start from
|
#ifndef XASH_GAMEDIR
|
||||||
|
#define XASH_GAMEDIR "valve"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void (*pfnChangeGame)( const char *progname );
|
typedef void (*pfnChangeGame)( const char *progname );
|
||||||
typedef int (*pfnInit)( int argc, char **argv, const char *progname, int bChangeGame, pfnChangeGame func );
|
typedef int (*pfnInit)( int argc, char **argv, const char *progname, int bChangeGame, pfnChangeGame func );
|
||||||
@ -152,7 +154,7 @@ _inline int Sys_Start( void )
|
|||||||
const char *game = getenv( E_GAME );
|
const char *game = getenv( E_GAME );
|
||||||
|
|
||||||
if( !game )
|
if( !game )
|
||||||
game = GAME_PATH;
|
game = XASH_GAMEDIR;
|
||||||
|
|
||||||
strncpy( szGameDir, game, sizeof( szGameDir ) - 1 );
|
strncpy( szGameDir, game, sizeof( szGameDir ) - 1 );
|
||||||
|
|
||||||
|
6
wscript
6
wscript
@ -64,6 +64,9 @@ def options(opt):
|
|||||||
grp.add_option('-d', '--dedicated', action = 'store_true', dest = 'DEDICATED', default = False,
|
grp.add_option('-d', '--dedicated', action = 'store_true', dest = 'DEDICATED', default = False,
|
||||||
help = 'build Xash Dedicated Server [default: %default]')
|
help = 'build Xash Dedicated Server [default: %default]')
|
||||||
|
|
||||||
|
grp.add_option('--gamedir', action = 'store', dest = 'GAMEDIR', default = 'valve',
|
||||||
|
help = 'engine default game directory [default: %default]')
|
||||||
|
|
||||||
grp.add_option('--single-binary', action = 'store_true', dest = 'SINGLE_BINARY', default = False,
|
grp.add_option('--single-binary', action = 'store_true', dest = 'SINGLE_BINARY', default = False,
|
||||||
help = 'build single "xash" binary (always enabled for dedicated) [default: %default]')
|
help = 'build single "xash" binary (always enabled for dedicated) [default: %default]')
|
||||||
|
|
||||||
@ -268,6 +271,9 @@ def configure(conf):
|
|||||||
conf.env.GL = conf.options.GL or conf.options.ALL_RENDERERS
|
conf.env.GL = conf.options.GL or conf.options.ALL_RENDERERS
|
||||||
conf.env.SOFT = conf.options.SOFT or conf.options.ALL_RENDERERS
|
conf.env.SOFT = conf.options.SOFT or conf.options.ALL_RENDERERS
|
||||||
|
|
||||||
|
conf.env.GAMEDIR = conf.options.GAMEDIR
|
||||||
|
conf.define('XASH_GAMEDIR', conf.options.GAMEDIR)
|
||||||
|
|
||||||
if conf.env.DEST_OS != 'win32':
|
if conf.env.DEST_OS != 'win32':
|
||||||
conf.check_cc(lib='dl', mandatory=False)
|
conf.check_cc(lib='dl', mandatory=False)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user