DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: david.marchand@redhat.com, Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH v3 3/4] examples: stop processing build file if build is impossible
Date: Wed, 11 Nov 2020 17:48:44 +0000	[thread overview]
Message-ID: <20201111174845.1768044-3-bruce.richardson@intel.com> (raw)
In-Reply-To: <20201111174845.1768044-1-bruce.richardson@intel.com>

Once it has been determined that an example cannot be built, there is
little point in continuing to process the meson.build file for that
example, so we can use subdir_done() to return to the calling file.
This can potentially prevent problems where later statement in the file
may cause an error on systems where the app cannot be built, e.g. on
Windows or FreeBSD.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/distributor/meson.build                     | 3 +++
 examples/ethtool/meson.build                         | 4 ++++
 examples/ioat/meson.build                            | 3 +++
 examples/ip_pipeline/meson.build                     | 4 ++++
 examples/kni/meson.build                             | 4 ++++
 examples/l2fwd-cat/meson.build                       | 4 ++++
 examples/ntb/meson.build                             | 2 ++
 examples/performance-thread/l3fwd-thread/meson.build | 4 ++++
 examples/performance-thread/pthread_shim/meson.build | 4 ++++
 examples/pipeline/meson.build                        | 4 ++++
 examples/vdpa/meson.build                            | 2 ++
 examples/vhost/meson.build                           | 2 ++
 examples/vhost_blk/meson.build                       | 2 ++
 examples/vhost_crypto/meson.build                    | 4 ++++
 14 files changed, 46 insertions(+)

diff --git a/examples/distributor/meson.build b/examples/distributor/meson.build
index 5244cd4ff..d8dbc235f 100644
--- a/examples/distributor/meson.build
+++ b/examples/distributor/meson.build
@@ -8,6 +8,9 @@
 
 # require the power library
 build = dpdk_conf.has('RTE_LIB_POWER')
+if not build
+	subdir_done()
+endif
 
 allow_experimental_apis = true
 deps += ['distributor', 'power']
diff --git a/examples/ethtool/meson.build b/examples/ethtool/meson.build
index cc8edac3d..4d08bc4c5 100644
--- a/examples/ethtool/meson.build
+++ b/examples/ethtool/meson.build
@@ -7,6 +7,10 @@
 # DPDK instance, use 'make'
 
 build = is_linux
+if not build
+	subdir_done()
+endif
+
 sources = files('lib/rte_ethtool.c',
 	'ethtool-app/ethapp.c',
 	'ethtool-app/main.c')
diff --git a/examples/ioat/meson.build b/examples/ioat/meson.build
index 6afbaa680..e348196ba 100644
--- a/examples/ioat/meson.build
+++ b/examples/ioat/meson.build
@@ -8,6 +8,9 @@
 
 allow_experimental_apis = true
 build = dpdk_conf.has('RTE_RAW_IOAT')
+if not build
+	subdir_done()
+endif
 
 deps += ['raw_ioat']
 
diff --git a/examples/ip_pipeline/meson.build b/examples/ip_pipeline/meson.build
index 664223c97..945e28b58 100644
--- a/examples/ip_pipeline/meson.build
+++ b/examples/ip_pipeline/meson.build
@@ -7,6 +7,10 @@
 # DPDK instance, use 'make'
 
 build = cc.has_header('sys/epoll.h')
+if not build
+	subdir_done()
+endif
+
 deps += ['pipeline', 'bus_pci']
 allow_experimental_apis = true
 sources = files(
diff --git a/examples/kni/meson.build b/examples/kni/meson.build
index 58639b139..e119eebab 100644
--- a/examples/kni/meson.build
+++ b/examples/kni/meson.build
@@ -8,6 +8,10 @@
 
 # this app can be built if-and-only-if KNI library is buildable
 build = dpdk_conf.has('RTE_LIB_KNI')
+if not build
+	subdir_done()
+endif
+
 deps += ['kni', 'bus_pci']
 sources = files(
 	'main.c'
diff --git a/examples/l2fwd-cat/meson.build b/examples/l2fwd-cat/meson.build
index 2bed18e74..60169bcbd 100644
--- a/examples/l2fwd-cat/meson.build
+++ b/examples/l2fwd-cat/meson.build
@@ -8,6 +8,10 @@
 
 pqos = cc.find_library('pqos', required: false)
 build = pqos.found()
+if not build
+	subdir_done()
+endif
+
 ext_deps += pqos
 allow_experimental_apis = true
 cflags += '-I/usr/local/include' # assume pqos lib installed in /usr/local
diff --git a/examples/ntb/meson.build b/examples/ntb/meson.build
index b0201f68b..02be9fc80 100644
--- a/examples/ntb/meson.build
+++ b/examples/ntb/meson.build
@@ -9,7 +9,9 @@
 allow_experimental_apis = true
 if not is_linux
 	build = false
+	subdir_done()
 endif
+
 deps += 'rawdev'
 cflags += ['-D_FILE_OFFSET_BITS=64']
 sources = files(
diff --git a/examples/performance-thread/l3fwd-thread/meson.build b/examples/performance-thread/l3fwd-thread/meson.build
index 99de24be7..4858b201e 100644
--- a/examples/performance-thread/l3fwd-thread/meson.build
+++ b/examples/performance-thread/l3fwd-thread/meson.build
@@ -7,6 +7,10 @@
 # DPDK instance, use 'make'
 
 build = dpdk_conf.has('RTE_ARCH_X86_64')
+if not build
+	subdir_done()
+endif
+
 deps += ['timer', 'lpm']
 allow_experimental_apis = true
 
diff --git a/examples/performance-thread/pthread_shim/meson.build b/examples/performance-thread/pthread_shim/meson.build
index 26ef78635..d49979930 100644
--- a/examples/performance-thread/pthread_shim/meson.build
+++ b/examples/performance-thread/pthread_shim/meson.build
@@ -7,6 +7,10 @@
 # DPDK instance, use 'make'
 
 build = dpdk_conf.has('RTE_ARCH_X86_64') or dpdk_conf.has('RTE_ARCH_ARM64')
+if not build
+	subdir_done()
+endif
+
 deps += ['timer']
 allow_experimental_apis = true
 
diff --git a/examples/pipeline/meson.build b/examples/pipeline/meson.build
index e47d483de..4f5925d7c 100644
--- a/examples/pipeline/meson.build
+++ b/examples/pipeline/meson.build
@@ -7,6 +7,10 @@
 # DPDK instance, use 'make'
 
 build = cc.has_header('sys/epoll.h')
+if not build
+	subdir_done()
+endif
+
 deps += ['pipeline', 'bus_pci']
 allow_experimental_apis = true
 sources = files(
diff --git a/examples/vdpa/meson.build b/examples/vdpa/meson.build
index 73f129cd9..26f6089c9 100644
--- a/examples/vdpa/meson.build
+++ b/examples/vdpa/meson.build
@@ -8,7 +8,9 @@
 
 if not is_linux
 	build = false
+	subdir_done()
 endif
+
 deps += 'vhost'
 allow_experimental_apis = true
 sources = files(
diff --git a/examples/vhost/meson.build b/examples/vhost/meson.build
index 24f1f7131..7e5b9d938 100644
--- a/examples/vhost/meson.build
+++ b/examples/vhost/meson.build
@@ -8,7 +8,9 @@
 
 if not is_linux
 	build = false
+	subdir_done()
 endif
+
 deps += 'vhost'
 allow_experimental_apis = true
 sources = files(
diff --git a/examples/vhost_blk/meson.build b/examples/vhost_blk/meson.build
index 857367192..354ba0584 100644
--- a/examples/vhost_blk/meson.build
+++ b/examples/vhost_blk/meson.build
@@ -8,10 +8,12 @@
 
 if not is_linux
 	build = false
+	subdir_done()
 endif
 
 if not cc.has_header('linux/virtio_blk.h')
 	build = false
+	subdir_done()
 endif
 
 deps += 'vhost'
diff --git a/examples/vhost_crypto/meson.build b/examples/vhost_crypto/meson.build
index b2c125e2f..403f21098 100644
--- a/examples/vhost_crypto/meson.build
+++ b/examples/vhost_crypto/meson.build
@@ -7,6 +7,10 @@
 # DPDK instance, use 'make'
 
 build = dpdk_conf.has('RTE_LIB_VHOST')
+if not build
+	subdir_done()
+endif
+
 allow_experimental_apis = true
 deps += ['vhost', 'cryptodev']
 sources = files(
-- 
2.25.1


  parent reply	other threads:[~2020-11-11 17:49 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10 17:08 [dpdk-dev] [PATCH] install: fix flattening of examples directory Bruce Richardson
2020-11-10 17:09 ` Bruce Richardson
2020-11-10 17:14   ` David Marchand
2020-11-10 17:33 ` [dpdk-dev] [dpdk-stable] " David Marchand
2020-11-10 17:42   ` Bruce Richardson
2020-11-11 15:56 ` [dpdk-dev] [PATCH v2 1/2] examples: fix flattening directory layout on install Bruce Richardson
2020-11-11 15:56   ` [dpdk-dev] [PATCH v2 2/2] examples: skip installing unbuildable examples Bruce Richardson
2020-11-11 17:33     ` Bruce Richardson
2020-11-12  9:14       ` David Marchand
2020-11-12  9:24         ` Bruce Richardson
2020-11-12  9:27           ` David Marchand
2020-11-12  9:35             ` Bruce Richardson
2020-11-11 17:48 ` [dpdk-dev] [PATCH v3 1/4] examples: fix flattening directory layout on install Bruce Richardson
2020-11-11 17:48   ` [dpdk-dev] [PATCH v3 2/4] examples/l2fwd-keepalive: skip build when no librt Bruce Richardson
2020-11-11 17:48   ` Bruce Richardson [this message]
2020-11-11 17:48   ` [dpdk-dev] [PATCH v3 4/4] examples: skip installing unbuildable examples Bruce Richardson
2020-11-12  9:41 ` [dpdk-dev] [PATCH v4 0/4] improve examples installation Bruce Richardson
2020-11-12  9:41   ` [dpdk-dev] [PATCH v4 1/4] examples: fix flattening directory layout on install Bruce Richardson
2020-11-12  9:41   ` [dpdk-dev] [PATCH v4 2/4] examples/l2fwd-keepalive: skip build when no librt Bruce Richardson
2020-11-12  9:41   ` [dpdk-dev] [PATCH v4 3/4] examples: stop processing build file if build is impossible Bruce Richardson
2020-11-12  9:41   ` [dpdk-dev] [PATCH v4 4/4] examples: skip installing unbuildable examples Bruce Richardson
2020-11-12 17:06     ` Thomas Monjalon
2020-11-12 11:14   ` [dpdk-dev] [PATCH v4 0/4] improve examples installation David Marchand
2020-11-12 11:38     ` Bruce Richardson
2020-11-12 13:48       ` David Marchand
2020-11-12 14:57         ` Bruce Richardson
2020-11-12 18:36   ` Thomas Monjalon

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=20201111174845.1768044-3-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    /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).