From efedca0d3c6d91918dec15bef0a5f4b4e27d2a43 Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Wed, 14 Aug 2024 23:29:46 +0200 Subject: [PATCH] Added SModule and dependencies.json for S++ 2.0 support. --- SModule | 40 ++++++++++++++++++++++++++++++++++++++++ dependencies.json | 6 ++++++ 2 files changed, 46 insertions(+) create mode 100644 SModule create mode 100644 dependencies.json 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'" + } +}