DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: gakhil@marvell.com, Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH 1/2] app/test: add support for optional dependencies
Date: Thu, 28 Sep 2023 12:04:49 +0100	[thread overview]
Message-ID: <20230928110450.862698-1-bruce.richardson@intel.com> (raw)
In-Reply-To: <20230928092639.162449-1-bruce.richardson@intel.com>

Some tests make optionally use a component but don't require it for
building. If we include the dependency in the per-file lists, then tests
may be unnecessarily omitted, as the dependency is not required.
On the other hand, removing the optional dependency from the list can
cause build failures, as the test case may include the optional code,
but then fail to build as the build system won't have added the necessary
paths for header inclusion, or the necessary libraries for linking.

Resolve this by explicitly providing a list of optional dependencies.
Any items in this list will be added to the dependency list if
available, but otherwise won't be involved in enable/disable of specific
tests.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/app/test/meson.build b/app/test/meson.build
index 05bae9216d..80b60f68b2 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -5,6 +5,10 @@
 deps += ['cmdline', 'ring', 'mempool', 'mbuf']
 sources += files('commands.c', 'test.c')
 
+# optional dependencies: some files may use these - and so we should link them in -
+# but do not explicitly require them so they are not listed in the per-file lists below
+optional_deps = []
+
 # some other utility C files, providing functions used by various tests
 # so we need to include these deps in the dependency list for the files using those fns.
 packet_burst_generator_deps = ['net']
@@ -226,6 +230,12 @@ foreach f, f_deps : source_file_deps
         sources += files(f)
     endif
 endforeach
+# add the optional dependencies
+foreach d:optional_deps
+    if is_variable(def_lib + '_rte_' + d) and d not in deps
+        deps += d
+    endif
+endforeach
 
 if cc.has_argument('-Wno-format-truncation')
     cflags += '-Wno-format-truncation'
-- 
2.39.2


  parent reply	other threads:[~2023-09-28 11:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28  9:26 [PATCH] app/test: drop dependency on crypto scheduler driver Bruce Richardson
2023-09-28  9:36 ` [EXT] " Akhil Goyal
2023-09-28  9:45   ` David Marchand
2023-09-28  9:55     ` Bruce Richardson
2023-09-28 11:04 ` Bruce Richardson [this message]
2023-09-28 11:04   ` [PATCH 2/2] app/test: make crypto scheduler an optional dependency Bruce Richardson
2023-09-28 12:50   ` [PATCH 1/2] app/test: add support for optional dependencies David Marchand
2023-09-28 13:06     ` [EXT] " Akhil Goyal
2023-09-28 14:42       ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230928110450.862698-1-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).