diff options
author | Chris Johns <chrisj@rtems.org> | 2023-04-19 14:32:18 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2023-04-19 14:32:18 +1000 |
commit | 68654b4f995382765605dc16917baad4bdbf7f7c (patch) | |
tree | 853894d05743eac34f5ad6e42102649e07038d6e | |
parent | Format with YAPF (diff) | |
download | rtems_waf-68654b4f995382765605dc16917baad4bdbf7f7c.tar.bz2 |
Parse includes in separate groups so isystem and sysroot paths and managed
- This fixes the support for the change in RTEMS to use -isystem
-rw-r--r-- | rtems.py | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -270,7 +270,9 @@ def configure(conf, bsp_configure=None): conf.env.WFLAGS = cflags['warnings'] conf.env.RFLAGS = cflags['specs'] conf.env.MFLAGS = cflags['machines'] - conf.env.IFLAGS = _clean_inc_opts(cflags['includes']) + conf.env.IFLAGS = _filter_inc_opts(cflags['includes'], '-I') + conf.env.ISYSTEM = _filter_inc_opts(cflags['includes'], '-isystem') + conf.env.ISYSROOT = _filter_inc_opts(cflags['includes'], '-sysroot') conf.env.LINKFLAGS = cflags['cflags'] + ldflags['ldflags'] conf.env.LIB = flags['LIB'] conf.env.LIBPATH = ldflags['libpath'] @@ -925,15 +927,12 @@ def _load_flags_set(flags, arch_bsp, conf, config, pkg): return flagstr.split() -def _clean_inc_opts(incpaths): +def _filter_inc_opts(incpaths, incopt): paths = [] - incopts = ['-I', '-isystem', '-sysroot'] for ip in incpaths: - for opt in incopts: - if ip.startswith(opt): - ip = ip[len(opt):] - break - paths += [ip] + if ip.startswith(incopt): + paths += [ip[len(incopt):]] + break return paths |