From 68654b4f995382765605dc16917baad4bdbf7f7c Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Wed, 19 Apr 2023 14:32:18 +1000 Subject: 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 -- cgit v1.2.3