]> git.droids-corp.org - dpdk.git/commitdiff
build: make pdump optional
authorDavid Marchand <david.marchand@redhat.com>
Wed, 17 Nov 2021 11:28:46 +0000 (12:28 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 17 Nov 2021 11:49:19 +0000 (12:49 +0100)
This library can be made optional.
dumpcap and pdump applications depend on this library, check for
dependencies like what we have for examples.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
app/meson.build
app/test/meson.build
lib/meson.build

index 310e83076f04d94866f554e639df0436571b684b..93d8c15032225956500c2ea6e60f3ca7c9de4be8 100644 (file)
@@ -43,15 +43,23 @@ foreach app:apps
 
     subdir(name)
 
+    if build
+        dep_objs = []
+        foreach d:deps
+            var_name = get_option('default_library') + '_rte_' + d
+            if not is_variable(var_name)
+                build = false
+                message('Missing dependency "@0@" for app "@1@"'.format(d, name))
+                break
+            endif
+            dep_objs += [get_variable(var_name)]
+        endforeach
+    endif
+
     if not build
         continue
     endif
 
-    dep_objs = []
-    foreach d:deps
-        dep_objs += get_variable(get_option('default_library') + '_rte_' + d)
-    endforeach
-
     link_libs = []
     if get_option('default_library') == 'static'
         link_libs = dpdk_static_libraries + dpdk_drivers
index 0d261b113833d7b56b20586ca43337d6c623122f..961bebc5cb0527c5ee4cd4895c95dce399032d13 100644 (file)
@@ -407,11 +407,9 @@ if dpdk_conf.has('RTE_NET_RING')
     test_sources += 'test_pmd_ring.c'
     test_sources += 'test_event_eth_tx_adapter.c'
     test_sources += 'sample_packet_forward.c'
-    test_sources += 'test_pdump.c'
     fast_tests += [['ring_pmd_autotest', true]]
     perf_test_names += 'ring_pmd_perf_autotest'
     fast_tests += [['event_eth_tx_adapter_autotest', false]]
-    fast_tests += [['pdump_autotest', true]]
     if dpdk_conf.has('RTE_LIB_BITRATESTATS')
         test_deps += 'bitratestats'
         test_sources += 'test_bitratestats.c'
@@ -422,6 +420,11 @@ if dpdk_conf.has('RTE_NET_RING')
         test_sources += 'test_latencystats.c'
         fast_tests += [['latencystats_autotest', true]]
     endif
+    if dpdk_conf.has('RTE_LIB_PDUMP')
+        test_deps += 'pdump'
+        test_sources += 'test_pdump.c'
+        fast_tests += [['pdump_autotest', true]]
+    endif
 endif
 
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
@@ -438,9 +441,6 @@ endif
 if dpdk_conf.has('RTE_LIB_KNI')
     test_deps += 'kni'
 endif
-if dpdk_conf.has('RTE_LIB_PDUMP')
-    test_deps += 'pdump'
-endif
 
 if cc.has_argument('-Wno-format-truncation')
     cflags += '-Wno-format-truncation'
index 961b95f4adf19a19ba6e7c9a368f6ddd860e4930..dad9fce14d02e5429fb9ac7a06f7cc25597a89ea 100644 (file)
@@ -73,6 +73,7 @@ optional_libs = [
         'jobstats',
         'latencystats',
         'metrics',
+        'pdump',
         'power',
         'vhost',
 ]