Drivers implementing a class of devices (for example, drivers/event)
depend on the associated abstraction library (lib/eventdev).
This dependency is expressed in the top level meson.build for this class
(drivers/event/meson.build).

As we are making more libraries optional, custom constructs referencing
the class dependencies in some drivers meson.build (event/dlb2) may break.

It would be possible to add more checks in those drivers meson.build but
it is more straightforward to not even consider a driver meson.build when
the class dependencies are not met.

Signed-off-by: David Marchand <david.march...@redhat.com>
Acked-by: Morten Brørup <m...@smartsharesystems.com>
---
Changes since v1:
- added break on the first missing dependency,
- added logs for disabled drivers,

---
 drivers/meson.build | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/meson.build b/drivers/meson.build
index 74ae8cb96b..c909070c30 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -70,6 +70,25 @@ foreach subpath:subdirs
     else
         class = subpath
         subdir(class)
+        skip_class = false
+        foreach d:std_deps
+            if not is_variable('shared_rte_' + d)
+                skip_class = true
+                reason = 'missing internal dependency, "@0@"'.format(d)
+                if dpdk_libs_deprecated.contains(d)
+                    reason += ' (deprecated lib)'
+                endif
+                message('Disabling @1@/* drivers: missing internal dependency 
"@0@"'
+                        .format(d, class))
+                break
+            endif
+        endforeach
+        if skip_class
+            drv_path = join_paths(class, '*')
+            dpdk_drvs_disabled += drv_path
+            set_variable(drv_path.underscorify() + '_disable_reason', reason)
+            continue
+        endif
     endif
 
     # save class name on first occurrence
-- 
2.41.0

Reply via email to