mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-12-15 05:29:51 +01:00
Alibek Omarov
d86ab19351
* Run filesystem tests in sequential order, to avoid tests being run before filesystem_stdio DLL is linked * Include new interface test in filesystem
50 lines
1.3 KiB
Python
50 lines
1.3 KiB
Python
#!/usr/bin/env python
|
|
|
|
def options(opt):
|
|
pass
|
|
|
|
def configure(conf):
|
|
nortti = {
|
|
'msvc': ['/GR-'],
|
|
'default': ['-fno-rtti', '-fno-exceptions']
|
|
}
|
|
conf.env.append_unique('CXXFLAGS', conf.get_flags_by_compiler(nortti, conf.env.COMPILER_CC))
|
|
|
|
if conf.env.DEST_OS != 'android':
|
|
if conf.env.cxxshlib_PATTERN.startswith('lib'):
|
|
conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:]
|
|
|
|
def build(bld):
|
|
bld(name = 'filesystem_includes', export_includes = '.')
|
|
|
|
libs = [ 'filesystem_includes' ]
|
|
# on PSVita do not link any libraries that are already in the main executable, but add the includes target
|
|
if bld.env.DEST_OS == 'psvita':
|
|
libs += [ 'sdk_includes' ]
|
|
else:
|
|
libs += [ 'public' ]
|
|
|
|
bld.shlib(target = 'filesystem_stdio',
|
|
features = 'cxx seq',
|
|
source = bld.path.ant_glob(['*.c', '*.cpp']),
|
|
use = libs,
|
|
install_path = bld.env.LIBDIR,
|
|
subsystem = bld.env.MSVC_SUBSYSTEM)
|
|
|
|
if bld.env.TESTS:
|
|
# build in same module, so dynamic linking will work
|
|
# for now (until we turn libpublic to shared module lol)
|
|
tests = {
|
|
'caseinsensitive' : 'tests/caseinsensitive.c',
|
|
'interface' : 'tests/interface.cpp',
|
|
}
|
|
|
|
for i in tests:
|
|
bld.program(features = 'test seq',
|
|
source = tests[i],
|
|
target = 'test_%s' % i,
|
|
use = libs + ['DL'],
|
|
rpath = '$ORIGIN',
|
|
subsystem = bld.env.CONSOLE_SUBSYSTEM,
|
|
install_path = None)
|