2022-07-01 18:37:21 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
def options(opt):
|
2023-04-13 17:40:27 +02:00
|
|
|
pass
|
2022-07-01 18:37:21 +02:00
|
|
|
|
|
|
|
def configure(conf):
|
2024-11-04 11:19:21 +01:00
|
|
|
if conf.env.COMPILER_CXX != 'msvc':
|
|
|
|
conf.env.append_unique('CXXFLAGS', ['-fno-exceptions'])
|
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:]
|
2022-07-01 18:37:21 +02:00
|
|
|
|
|
|
|
def build(bld):
|
2022-09-10 18:56:12 +02:00
|
|
|
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
|
|
|
|
2022-07-01 18:37:21 +02:00
|
|
|
bld.shlib(target = 'filesystem_stdio',
|
2024-10-23 22:20:47 +02:00
|
|
|
features = 'seq',
|
2022-07-11 02:58:59 +02:00
|
|
|
source = bld.path.ant_glob(['*.c', '*.cpp']),
|
2023-02-13 20:53:17 +01:00
|
|
|
use = libs,
|
2022-07-01 18:37:21 +02:00
|
|
|
install_path = bld.env.LIBDIR,
|
|
|
|
subsystem = bld.env.MSVC_SUBSYSTEM)
|
2022-12-26 16:58:44 +01:00
|
|
|
|
2023-04-13 17:40:27 +02:00
|
|
|
if bld.env.TESTS:
|
2022-12-26 16:58:44 +01:00
|
|
|
# build in same module, so dynamic linking will work
|
|
|
|
# for now (until we turn libpublic to shared module lol)
|
2023-04-13 17:40:27 +02:00
|
|
|
tests = {
|
|
|
|
'interface' : 'tests/interface.cpp',
|
2023-04-13 19:07:58 +02:00
|
|
|
'caseinsensitive' : 'tests/caseinsensitive.c',
|
2023-05-26 16:48:06 +02:00
|
|
|
'no-init': 'tests/no-init.c'
|
2023-04-13 17:40:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for i in tests:
|
|
|
|
bld.program(features = 'test seq',
|
|
|
|
source = tests[i],
|
|
|
|
target = 'test_%s' % i,
|
|
|
|
use = libs + ['DL'],
|
2023-06-01 03:56:30 +02:00
|
|
|
rpath = bld.env.DEFAULT_RPATH,
|
2023-04-13 17:40:27 +02:00
|
|
|
subsystem = bld.env.CONSOLE_SUBSYSTEM,
|
|
|
|
install_path = None)
|