Added MakeInterface command that just copies dependencies include folders/defines.

This commit is contained in:
Patrick 2024-07-27 15:59:46 +02:00
parent 34b2bc1e5b
commit 63b670e77c

View File

@ -56,6 +56,15 @@ def _rglob(env: Environment, root_path: str, pattern: str, **kwargs):
result_nodes.extend(env.Glob(f'{path}/{pattern}', **kwargs))
return sorted(result_nodes)
def _make_interface(env: Environment, dependencies: list = []):
kwargs = {}
for dependency in dependencies:
_inject_dependency(dependency, kwargs)
return {
'CPPPATH': kwargs.get('CPPPATH', []),
'CPPDEFINES': kwargs.get('CPPDEFINES', [])
}
def _error(env: Environment, message: str):
print(message, file=sys.stderr)
env.Exit(1)
@ -383,6 +392,7 @@ elif env['COMPILER_FAMILY'] == 'clang':
env.AddMethod(_cook, 'Cook')
env.AddMethod(_parse_lib_conf, 'ParseLibConf')
env.AddMethod(_rglob, 'RGlob')
env.AddMethod(_make_interface, 'MakeInterface')
env.AddMethod(_error, 'Error')
env.AddMethod(_wrap_builder(env.Library, is_lib = True), 'Library')
env.AddMethod(_wrap_builder(env.StaticLibrary, is_lib = True), 'StaticLibrary')