[PATCH v5 01/27] build: add build defines for component name and class
Anatoly Burakov
anatoly.burakov at intel.com
Mon May 25 16:06:20 CEST 2026
From: Bruce Richardson <bruce.richardson at intel.com>
When building each component, pass in -D flags to define for it the
component class and name. This allows any files which may be used
multiple times to identify what component is including them.
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/meson.build | 2 ++
lib/meson.build | 2 ++
2 files changed, 4 insertions(+)
diff --git a/drivers/meson.build b/drivers/meson.build
index 6ae102e943..35f8447e06 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -263,6 +263,8 @@ foreach subpath:subdirs
enabled_drivers += name
lib_name = '_'.join(['rte', class, name])
+ cflags += '-DRTE_COMPONENT_CLASS=pmd_' + class
+ cflags += '-DRTE_COMPONENT_NAME=' + name
cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=' + '.'.join([log_prefix, name])
if annotate_locks and cc.get_id() == 'clang'
cflags += '-DRTE_ANNOTATE_LOCKS'
diff --git a/lib/meson.build b/lib/meson.build
index 8f5cfd28a5..af5c160cb8 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -237,6 +237,8 @@ foreach l:libraries
cflags += '-DRTE_USE_FUNCTION_VERSIONING'
endif
cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=lib.' + l
+ cflags += '-DRTE_COMPONENT_CLASS=lib'
+ cflags += '-DRTE_COMPONENT_NAME=' + name
if annotate_locks and cc.get_id() == 'clang'
cflags += '-DRTE_ANNOTATE_LOCKS'
cflags += '-Wthread-safety'
--
2.47.3
More information about the dev
mailing list