[dpdk-dev,6/7] examples/kni: fix dependency check for building with meson

Message ID 20180608163807.66737-7-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Enable 32-bit native builds with meson |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Bruce Richardson June 8, 2018, 4:38 p.m. UTC
  Rather than hard-coding the example app to be built only when a set of
conditions are met, we can simplify things by having the app built when
KNI library itself is available. That saves us duplicating the same set
of restrictions on both library and example app.

Fixes: 89f0711f9ddf ("examples: build some samples with meson")

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

Comments

Ferruh Yigit July 2, 2018, 11:47 p.m. UTC | #1
On 6/8/2018 5:38 PM, Bruce Richardson wrote:
> Rather than hard-coding the example app to be built only when a set of
> conditions are met, we can simplify things by having the app built when
> KNI library itself is available. That saves us duplicating the same set
> of restrictions on both library and example app.
> 
> Fixes: 89f0711f9ddf ("examples: build some samples with meson")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  examples/kni/meson.build | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/examples/kni/meson.build b/examples/kni/meson.build
> index 0443ab99b..41b87f8b3 100644
> --- a/examples/kni/meson.build
> +++ b/examples/kni/meson.build
> @@ -6,9 +6,8 @@
>  # To build this example as a standalone application with an already-installed
>  # DPDK instance, use 'make'
>  
> -if host_machine.system() != 'linux'
> -	build = false
> -endif
> +# this app can be built if-and-only-if KNI library is buildable
> +build = dpdk_conf.has('LIB_LIBRTE_KNI')

s/LIB_LIBRTE_KNI/RTE_LIBRTE_KNI/

Same needs to be updated in drivers/net/kni/meson.build too

>  deps += ['kni', 'bus_pci']
>  sources = files(
>  	'main.c'
>
  
Bruce Richardson July 3, 2018, 10:07 a.m. UTC | #2
On Tue, Jul 03, 2018 at 12:47:18AM +0100, Ferruh Yigit wrote:
> On 6/8/2018 5:38 PM, Bruce Richardson wrote:
> > Rather than hard-coding the example app to be built only when a set of
> > conditions are met, we can simplify things by having the app built when
> > KNI library itself is available. That saves us duplicating the same set
> > of restrictions on both library and example app.
> > 
> > Fixes: 89f0711f9ddf ("examples: build some samples with meson")
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >  examples/kni/meson.build | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/examples/kni/meson.build b/examples/kni/meson.build
> > index 0443ab99b..41b87f8b3 100644
> > --- a/examples/kni/meson.build
> > +++ b/examples/kni/meson.build
> > @@ -6,9 +6,8 @@
> >  # To build this example as a standalone application with an already-installed
> >  # DPDK instance, use 'make'
> >  
> > -if host_machine.system() != 'linux'
> > -	build = false
> > -endif
> > +# this app can be built if-and-only-if KNI library is buildable
> > +build = dpdk_conf.has('LIB_LIBRTE_KNI')
> 
> s/LIB_LIBRTE_KNI/RTE_LIBRTE_KNI/
> 
> Same needs to be updated in drivers/net/kni/meson.build too
> 
Thanks, good catch.
  

Patch

diff --git a/examples/kni/meson.build b/examples/kni/meson.build
index 0443ab99b..41b87f8b3 100644
--- a/examples/kni/meson.build
+++ b/examples/kni/meson.build
@@ -6,9 +6,8 @@ 
 # To build this example as a standalone application with an already-installed
 # DPDK instance, use 'make'
 
-if host_machine.system() != 'linux'
-	build = false
-endif
+# this app can be built if-and-only-if KNI library is buildable
+build = dpdk_conf.has('LIB_LIBRTE_KNI')
 deps += ['kni', 'bus_pci']
 sources = files(
 	'main.c'