[PATCH] build: Do not convert cflags to defines

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jun 15 05:21:13 UTC 2020


This makes it possible to use module-specific C flags, for example to
instrument functions (-finstrument-functions).
---
 waf_libbsd.py | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/waf_libbsd.py b/waf_libbsd.py
index 14f2ae78..310a6924 100644
--- a/waf_libbsd.py
+++ b/waf_libbsd.py
@@ -452,19 +452,11 @@ class Builder(builder.ModuleManager):
             for arch in archs:
                 if bld.get_env()['RTEMS_ARCH'] == arch:
                     bld_sources += Builder._sourceList(bld, build[arch])
-            if 'cflags' in build:
-                bld_defines = [d[2:] for d in build['cflags']]
-            else:
-                bld_defines = []
-            if 'includes' in build:
-                bld_includes = build['includes']
-            else:
-                bld_includes = []
             bld.objects(target = target,
                         features = 'c',
-                        cflags = cflags,
-                        includes = sorted(bld_includes) + includes,
-                        defines = defines + sorted(bld_defines),
+                        cflags = cflags + sorted(build.get('cflags', [])),
+                        includes = sorted(build.get('includes', [])) + includes,
+                        defines = defines,
                         source = bld_sources)
             libbsd_use += [target]
 
-- 
2.26.2



More information about the devel mailing list