mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
wscript: detect threading ability by platform
On client, it's handled by SDL{2,3}. On server we rely on pthreads (and some platforms don't have pthreads).
This commit is contained in:
@@ -24,9 +24,6 @@ def options(opt):
|
||||
grp.add_option('--enable-fbdev', action = 'store_true', dest = 'FBDEV_SW', default = False,
|
||||
help = 'build fbdev-only software-only engine')
|
||||
|
||||
grp.add_option('--disable-async-resolve', action = 'store_true', dest = 'NO_ASYNC_RESOLVE', default = False,
|
||||
help = 'disable multithreaded operations(asynchronous name resolution)')
|
||||
|
||||
grp.add_option('--enable-custom-swap', action = 'store_true', dest = 'CUSTOM_SWAP', default = False,
|
||||
help = 'enable custom swap allocator. For devices with no swap support')
|
||||
|
||||
@@ -63,6 +60,8 @@ def find_sdl(conf):
|
||||
conf.env.XASH_SDL = 2
|
||||
|
||||
def configure(conf):
|
||||
have_async_resolve = True
|
||||
|
||||
# Common dependencies, will be linked to both dedicated server and client
|
||||
if conf.env.DEST_OS == 'linux':
|
||||
conf.check_cc(lib='rt')
|
||||
@@ -72,13 +71,13 @@ def configure(conf):
|
||||
conf.env.LIB_HAIKU = ['network']
|
||||
conf.env.LIBPATH_HAIKU = ['/boot/system/lib']
|
||||
elif conf.env.DEST_OS == 'wasi':
|
||||
conf.options.NO_ASYNC_RESOLVE = True
|
||||
have_async_resolve = False
|
||||
conf.env.CFLAGS += ['-mllvm', '-wasm-enable-sjlj']
|
||||
elif conf.env.DEST_OS == 'sunos':
|
||||
conf.check_cc(lib='socket')
|
||||
elif conf.env.DEST_OS == 'dos':
|
||||
conf.options.STATIC = True
|
||||
conf.options.NO_ASYNC_RESOLVE = True
|
||||
have_async_resolve = False
|
||||
|
||||
if conf.options.ENGINE_FUZZ:
|
||||
conf.env.append_unique('CFLAGS', '-fsanitize=fuzzer-no-link')
|
||||
@@ -105,6 +104,7 @@ def configure(conf):
|
||||
elif conf.options.SDL12: # TODO: move to sdl2.py
|
||||
conf.check_cfg(package='sdl', args='--cflags --libs', uselib_store='SDL1')
|
||||
conf.env.XASH_SDL = 1
|
||||
have_async_resolve = False
|
||||
conf.env.HAVE_SDL1 = True
|
||||
else:
|
||||
find_sdl(conf)
|
||||
@@ -114,7 +114,7 @@ def configure(conf):
|
||||
conf.env.STATIC = True
|
||||
conf.define('XASH_NO_LIBDL', 1)
|
||||
|
||||
if not conf.env.DEST_OS in ['win32', 'android'] and not conf.options.NO_ASYNC_RESOLVE:
|
||||
if not conf.env.DEST_OS in ['win32', 'android'] and have_async_resolve:
|
||||
conf.check_pthreads(mode='c')
|
||||
|
||||
if hasattr(conf.options, 'DLLEMU'):
|
||||
@@ -126,7 +126,7 @@ def configure(conf):
|
||||
conf.define_cond('XASH_ENGINE_TESTS', conf.options.ENGINE_TESTS)
|
||||
conf.define_cond('XASH_STATIC_LIBS', conf.env.STATIC_LINKING)
|
||||
conf.define_cond('XASH_CUSTOM_SWAP', conf.options.CUSTOM_SWAP)
|
||||
conf.define_cond('XASH_NO_ASYNC_NS_RESOLVE', conf.options.NO_ASYNC_RESOLVE)
|
||||
conf.define_cond('XASH_NO_ASYNC_NS_RESOLVE', not have_async_resolve)
|
||||
conf.define_cond('PSAPI_VERSION', conf.env.DEST_OS == 'win32') # will be defined as 1
|
||||
|
||||
for refdll in conf.refdlls:
|
||||
|
||||
Reference in New Issue
Block a user