[PATCH v9 1/5] lib: allow libraries with no sources

Paul Szczepanek paul.szczepanek at arm.com
Mon Mar 11 15:47:02 CET 2024


Allow header only libraries.

Signed-off-by: Paul Szczepanek <paul.szczepanek at arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
---
 lib/meson.build | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/meson.build b/lib/meson.build
index 179a272932..e4e31f7ecf 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -222,6 +222,20 @@ foreach l:libraries
     includes += include_directories(l)
     dpdk_includes += include_directories(l)

+    # special case for header only libraries
+    if sources.length() == 0
+        header_lib_dep = declare_dependency(include_directories: includes,
+                dependencies: shared_deps)
+        set_variable('shared_rte_' + name, header_lib_dep)
+        set_variable('static_rte_' + name, header_lib_dep)
+        dpdk_shared_lib_deps += header_lib_dep
+        dpdk_static_lib_deps += header_lib_dep
+        if developer_mode
+            message('lib/@0@: Defining dependency "@1@"'.format(l, name))
+        endif
+        continue
+    endif
+
     if developer_mode and is_windows and use_function_versioning
         message('@0@: Function versioning is not supported by Windows.'.format(name))
     endif
--
2.25.1



More information about the dev mailing list