diff --git a/SModule b/SModule new file mode 100644 index 0000000..880d97f --- /dev/null +++ b/SModule @@ -0,0 +1,40 @@ + +import json + + +Import('env') + +mijin_sources = Split(""" + source/mijin/async/coroutine.cpp + source/mijin/debug/stacktrace.cpp + source/mijin/debug/symbol_info.cpp + source/mijin/io/process.cpp + source/mijin/io/stream.cpp + source/mijin/util/os.cpp + source/mijin/types/name.cpp + source/mijin/virtual_filesystem/filesystem.cpp + source/mijin/virtual_filesystem/stacked.cpp +""") + +with open('dependencies.json', 'r') as f: + dependencies = env.DepsFromJson(json.load(f)) + +cppdefines = [] +if env['BUILD_TYPE'] == 'debug': + cppdefines += ['MIJIN_DEBUG=1', 'MIJIN_CHECKED_ITERATORS=1'] + + +lib_mijin = env.UnityStaticLibrary( + target = env['LIB_DIR'] + '/mijin', + source = mijin_sources, + dependencies = dependencies, + CPPDEFINES = list(env['CPPDEFINES']) + cppdefines +) + +LIB_CONFIG = { + 'CPPPATH': [env.Dir('source')], + 'CPPDEFINES': cppdefines, + 'LIBS': [lib_mijin] +} + +Return('LIB_CONFIG') diff --git a/dependencies.json b/dependencies.json new file mode 100644 index 0000000..482b106 --- /dev/null +++ b/dependencies.json @@ -0,0 +1,6 @@ +{ + "libbacktrace": + { + "condition": "compiler_family == 'gcc' or compiler_family == 'clang'" + } +}