Added imgui and an option to inject source files into dependant projects.
This commit is contained in:
@@ -30,15 +30,17 @@ def _inject_list(kwargs: dict, dependency: dict, list_name: str) -> None:
|
||||
kwargs[list_name] = []
|
||||
kwargs[list_name].extend(dependency[list_name]) # TODO: eliminiate duplicates?
|
||||
|
||||
def _inject_dependency(dependency, kwargs: dict) -> None:
|
||||
def _inject_dependency(dependency, kwargs: dict, add_sources: bool = True) -> None:
|
||||
if isinstance(dependency, dict):
|
||||
_inject_list(kwargs, dependency, 'CPPPATH')
|
||||
_inject_list(kwargs, dependency, 'CPPDEFINES')
|
||||
_inject_list(kwargs, dependency, 'LIBPATH')
|
||||
_inject_list(kwargs, dependency, 'LIBS')
|
||||
if add_sources and 'ADDITIONAL_SOURCES' in dependency:
|
||||
kwargs['source'].extend(dependency['ADDITIONAL_SOURCES'])
|
||||
if 'DEPENDENCIES' in dependency:
|
||||
for inner_dependency in dependency['DEPENDENCIES']:
|
||||
_inject_dependency(inner_dependency, kwargs)
|
||||
_inject_dependency(inner_dependency, kwargs, False)
|
||||
|
||||
def _rglob(env: Environment, root_path: str, pattern: str, **kwargs):
|
||||
result_nodes = []
|
||||
@@ -70,6 +72,7 @@ def _wrap_builder(builder, is_lib: bool = False):
|
||||
'CPPDEFINES': kwargs.get('CPPDEFINES', []),
|
||||
'LIBPATH': kwargs.get('LIBPATH', []),
|
||||
'LIBS': result + kwargs.get('LIBS', []),
|
||||
'ADDITIONAL_SOURCES': kwargs.get('add_source', []),
|
||||
'_target': result
|
||||
}
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user