Browse Source

wscript: use ConfigurationContext.define instead of appending to env['DEFINES']

pull/2/head
Alibek Omarov 5 years ago
parent
commit
8889bda261
  1. 25
      engine/wscript
  2. 2
      mainui
  3. 2
      ref_gl/gl-wes-v2
  4. 2
      ref_gl/nanogl
  5. 17
      ref_gl/wscript
  6. 2
      wscript

25
engine/wscript

@ -22,7 +22,7 @@ def configure(conf): @@ -22,7 +22,7 @@ def configure(conf):
if conf.options.DEDICATED:
if conf.env.DEST_OS == 'linux':
conf.check_cc( lib='rt' )
conf.env.append_unique('DEFINES', 'XASH_DEDICATED=1')
conf.define('XASH_DEDICATED', 1)
elif conf.env.DEST_OS == 'android': # Android doesn't need SDL2
for i in ['android', 'log', 'EGL']:
conf.check_cc(lib = i)
@ -30,26 +30,17 @@ def configure(conf): @@ -30,26 +30,17 @@ def configure(conf):
conf.load('sdl2')
if not conf.env.HAVE_SDL2:
conf.fatal('SDL2 not availiable! If you want to build dedicated server, specify --dedicated')
conf.env.append_unique('DEFINES', 'XASH_SDL')
if conf.env.SINGLE_BINARY:
conf.env.append_unique('DEFINES', 'SINGLE_BINARY')
conf.define('XASH_SDL', 1)
if conf.options.USE_SELECT == None:
conf.options.USE_SELECT = conf.options.DEDICATED
if conf.options.USE_SELECT:
conf.env.append_unique('DEFINES', 'XASH_USE_SELECT')
if conf.options.SUPPORT_BSP2_FORMAT:
conf.env.append_unique('DEFINES', 'SUPPORT_BSP2_FORMAT')
if conf.env.DEST_OS == 'win32':
conf.env.append_unique('DEFINES', 'DBGHELP')
conf.env.append_unique('DEFINES', 'PSAPI_VERSION=1')
if conf.env.DEST_SIZEOF_VOID_P != 4:
conf.env.append_unique('DEFINES', 'XASH_64BIT')
conf.define_cond('SINGLE_BINARY', conf.env.SINGLE_BINARY)
conf.define_cond('XASH_USE_SELECT', conf.options.USE_SELECT)
conf.define_cond('SUPPORT_BSP2_FORMAT', conf.options.SUPPORT_BSP2_FORMAT)
conf.define_cond('XASH_64BIT', conf.env.DEST_SIZEOF_VOID_P != 4)
conf.define_cond('DBGHELP', conf.env.DEST_OS == 'win32')
conf.define_cond('PSAPI_VERSION', conf.env.DEST_OS == 'win32') # will be defined as 1
def build(bld):
libs = [ 'public' ]

2
mainui

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit 78467eb7e4fd4e24a75d2115e94d0f7567cfed85
Subproject commit c95b7e59be219dc1acb4ec95fd6fc2b75f4393ab

2
ref_gl/gl-wes-v2

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit c5d2f80ad936d30d3c0503a21df7467ce9c87779
Subproject commit 73b552c67a44cf055321ef08dd26cc0ac23f585f

2
ref_gl/nanogl

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit 00f19060368987077d5936425e5b233b1d500ad6
Subproject commit b5a056408b1fdf8e8c33c7cf988d7ba8f280d290

17
ref_gl/wscript

@ -30,8 +30,7 @@ def configure(conf): @@ -30,8 +30,7 @@ def configure(conf):
if conf.options.DEDICATED:
return
if conf.options.SUPPORT_BSP2_FORMAT:
conf.env.append_unique('DEFINES', 'SUPPORT_BSP2_FORMAT')
conf.define_cond('SUPPORT_BSP2_FORMAT', conf.options.SUPPORT_BSP2_FORMAT)
conf.env.NANOGL = conf.options.NANOGL
conf.env.GLWES = conf.options.GLWES
@ -46,7 +45,7 @@ def configure(conf): @@ -46,7 +45,7 @@ def configure(conf):
if conf.env.GL_STATIC:
conf.check( lib='GL' )
conf.env.append_unique('DEFINES', 'REF_DLL')
conf.define('REF_DLL', 1)
if conf.env.DEST_OS2 == 'android':
conf.check_cc(lib='log')
@ -64,22 +63,14 @@ def build(bld): @@ -64,22 +63,14 @@ def build(bld):
'../common',
'../pm_shared' ]
def link_gl( glstatic ):
if glstatic: return ['GL']
else: return []
def static_gl( glstatic ):
if glstatic: return ['XASH_GL_STATIC']
else: return []
if bld.env.GL:
bld.shlib(
source = source,
target = 'ref_gl',
features = 'c',
includes = includes,
use = libs + link_gl(bld.env.GL_STATIC),
defines = static_gl(bld.env.GL_STATIC),
use = libs + ['GL'] if bld.env.GL_STATIC else [],
defines = ['XASH_GL_STATIC'] if bld.env.GL_STATIC else [],
install_path = bld.env.LIBDIR,
subsystem = bld.env.MSVC_SUBSYSTEM
)

2
wscript

@ -265,7 +265,7 @@ def configure(conf): @@ -265,7 +265,7 @@ def configure(conf):
else:
conf.env.LIBDIR = conf.env.BINDIR = conf.env.PREFIX
conf.env.append_unique('DEFINES', 'XASH_BUILD_COMMIT="{0}"'.format(conf.env.GIT_VERSION if conf.env.GIT_VERSION else 'notset'))
conf.define('XASH_BUILD_COMMIT', conf.env.GIT_VERSION if conf.env.GIT_VERSION else 'notset')
for i in SUBDIRS:
if conf.env.SINGLE_BINARY and i.singlebin:

Loading…
Cancel
Save