[v3,1/3] build: track mandatory rather than optional libs

Message ID 20231220142152.492556-2-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series Improve optional lib support |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Dec. 20, 2023, 2:21 p.m. UTC
  DPDK now has more optional libraries than mandatory ones, so invert the
list stored in the meson.build file from the optional ones to the
"always_enable" ones. As well as being a shorter list:

* we can remove the loop building up the "always_enable" list
  dynamically from the optional list
* it better aligns with the drivers/meson.build file which maintains an
  always_enable list.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 lib/meson.build | 70 +++++++++++++++++--------------------------------
 1 file changed, 24 insertions(+), 46 deletions(-)
  

Patch

diff --git a/lib/meson.build b/lib/meson.build
index 6c143ce5a6..8c922d3097 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -75,52 +75,29 @@  if is_ms_compiler
     ]
 endif
 
-optional_libs = [
-        'bbdev',
-        'bitratestats',
-        'bpf',
-        'cfgfile',
-        'compressdev',
-        'cryptodev',
-        'dispatcher',
-        'distributor',
-        'dmadev',
-        'efd',
-        'eventdev',
-        'gpudev',
-        'graph',
-        'gro',
-        'gso',
-        'ip_frag',
-        'ipsec',
-        'jobstats',
-        'latencystats',
-        'member',
-        'metrics',
-        'mldev',
-        'node',
-        'pcapng',
-        'pdcp',
-        'pdump',
-        'pipeline',
-        'port',
-        'power',
-        'rawdev',
-        'regexdev',
-        'reorder',
-        'sched',
-        'security',
-        'table',
-        'vhost',
+always_enable = [
+        'acl',
+        'cmdline',
+        'eal',
+        'ethdev',
+        'fib',
+        'hash',
+        'kvargs',
+        'log',
+        'lpm',
+        'mbuf',
+        'mempool',
+        'meter',
+        'net',
+        'pci',
+        'rcu',
+        'rib',
+        'ring',
+        'stack',
+        'telemetry',
+        'timer',
 ]
 
-always_enable = []
-foreach l:libraries
-    if not optional_libs.contains(l)
-        always_enable += l
-    endif
-endforeach
-
 enable_deprecated_libs = []
 foreach l:run_command(list_dir_globs, get_option('enable_deprecated_libs'),
         check: true).stdout().split()
@@ -136,9 +113,10 @@  enable_libs = run_command(list_dir_globs, get_option('enable_libs'), check: true
 require_libs = true
 if enable_libs.length() == 0
     require_libs = false
-    enable_libs += optional_libs
+    enable_libs = libraries
+else
+    enable_libs += always_enable
 endif
-enable_libs += always_enable
 
 default_cflags = machine_args
 default_cflags += ['-DALLOW_EXPERIMENTAL_API']