2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-27 04:11:08 +01:00
xash3d-fwgs/filesystem/wscript

51 lines
1.5 KiB
Plaintext
Raw Normal View History

#!/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))
2023-11-03 12:48:09 +01:00
if conf.env.DEST_OS == 'android':
conf.check_cc(lib='android')
elif conf.env.cxxshlib_PATTERN.startswith('lib'): # remove lib prefix for other systems than Android
conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:]
def build(bld):
bld(name = 'filesystem_includes', export_includes = '.')
2023-02-13 20:53:17 +01:00
2024-01-30 13:04:57 +01:00
libs = [ 'filesystem_includes', 'sdk_includes', 'werror' ]
2023-11-03 12:48:09 +01:00
2023-02-13 20:53:17 +01:00
# on PSVita do not link any libraries that are already in the main executable, but add the includes target
2023-11-03 12:48:09 +01:00
if bld.env.DEST_OS != 'psvita':
libs += [ 'public', 'ANDROID' ]
2023-02-13 20:53:17 +01:00
bld.shlib(target = 'filesystem_stdio',
features = 'cxx seq',
source = bld.path.ant_glob(['*.c', '*.cpp']),
2023-02-13 20:53:17 +01:00
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 = {
'interface' : 'tests/interface.cpp',
'caseinsensitive' : 'tests/caseinsensitive.c',
'no-init': 'tests/no-init.c'
}
for i in tests:
bld.program(features = 'test seq',
source = tests[i],
target = 'test_%s' % i,
use = libs + ['DL'],
rpath = bld.env.DEFAULT_RPATH,
subsystem = bld.env.CONSOLE_SUBSYSTEM,
install_path = None)