mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-16 20:18:13 +08:00
waf: Add path-mappings feature
- path-mappings allow to fix autogenerated include paths for some corner cases of target platforms without the need to change the build system - Currently used for i386 based bsps
This commit is contained in:

committed by
Sebastian Huber

parent
ce5b52d575
commit
dbf72c205d
@@ -210,8 +210,6 @@ class Builder(builder.ModuleManager):
|
||||
buildinclude = 'build-include'
|
||||
if 'cpu-include-paths' in config:
|
||||
cpu = bld.get_env()['RTEMS_ARCH']
|
||||
if cpu == "i386":
|
||||
cpu = 'x86'
|
||||
for i in config['cpu-include-paths']:
|
||||
includes += [i.replace('@CPU@', cpu)]
|
||||
if 'include-paths' in config:
|
||||
@@ -222,6 +220,17 @@ class Builder(builder.ModuleManager):
|
||||
buildinclude = buildinclude[0]
|
||||
includes += [buildinclude]
|
||||
|
||||
#
|
||||
# Path mappings
|
||||
#
|
||||
if 'path-mappings' in config:
|
||||
for source, target in config['path-mappings']:
|
||||
if source in includes:
|
||||
target = [target] if isinstance(target, str) else target
|
||||
i = includes.index(source)
|
||||
includes.remove(source)
|
||||
includes[i:i] = target
|
||||
|
||||
#
|
||||
# Collect the libbsd uses
|
||||
#
|
||||
|
Reference in New Issue
Block a user