[rtems_waf commit] Parse includes in separate groups so isystem and sysroot paths and managed

Chris Johns chrisj at rtems.org
Wed Apr 19 04:16:05 UTC 2023


Module:    rtems_waf
Branch:    master
Commit:    68654b4f995382765605dc16917baad4bdbf7f7c
Changeset: http://git.rtems.org/rtems_waf/commit/?id=68654b4f995382765605dc16917baad4bdbf7f7c

Author:    Chris Johns <chrisj at rtems.org>
Date:      Wed Apr 19 14:32:18 2023 +1000

Parse includes in separate groups so isystem and sysroot paths and managed

- This fixes the support for the change in RTEMS to use -isystem

---

 rtems.py | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/rtems.py b/rtems.py
index b618157..0b24645 100644
--- a/rtems.py
+++ b/rtems.py
@@ -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
 
 



More information about the vc mailing list