DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 1/2] examples/ethtool: add to meson build
Date: Thu, 29 Mar 2018 15:04:56 +0100	[thread overview]
Message-ID: <20180329140457.93034-2-bruce.richardson@intel.com> (raw)
In-Reply-To: <20180329140457.93034-1-bruce.richardson@intel.com>

Add the ethtool example to the meson build. This example is more
complicated than the previously added ones as it has files in two
subdirectories. An ethtool "wrapper lib" in one, used by the actual
example "ethtool app" in the other.

Rather than using recursive operation, like is done with the makefiles,
we instead can just special-case the building of the library from the
single .c file, and then use that as a dependency when building the app
proper.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/ethtool/meson.build | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/examples/ethtool/meson.build b/examples/ethtool/meson.build
index c370d7476..0ec2a2391 100644
--- a/examples/ethtool/meson.build
+++ b/examples/ethtool/meson.build
@@ -6,5 +6,14 @@
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-# Example app currently unsupported by meson build
-build = false
+# build the ethtool wrapper as a lib, which app uses as a dependency
+ethtool_inc = include_directories('lib')
+ethtool_lib = static_library('rte_ethtool', 'lib/rte_ethtool.c',
+		include_directories: ethtool_inc,
+		dependencies: [static_rte_ethdev, static_rte_pmd_ixgbe])
+ethtool_dep = declare_dependency(link_with: ethtool_lib,
+	include_directories: ethtool_inc)
+
+# sample app files are in the ethtool-app subdir
+sources = files('ethtool-app/ethapp.c', 'ethtool-app/main.c')
+ext_deps += ethtool_dep
-- 
2.14.3

  reply	other threads:[~2018-03-29 14:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 14:04 [dpdk-dev] [PATCH 0/2] support building ethtool example using meson Bruce Richardson
2018-03-29 14:04 ` Bruce Richardson [this message]
2018-07-12  7:54   ` [dpdk-dev] [PATCH 1/2] examples/ethtool: add to meson build Thomas Monjalon
2018-07-12 10:46     ` Bruce Richardson
2018-03-29 14:04 ` [dpdk-dev] [PATCH 2/2] examples/ethtool: enable build using pkg-config vars Bruce Richardson

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=20180329140457.93034-2-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.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).