[v1,1/3] meson: add a meson option to install examples
Checks
Commit Message
Adding a meson option "enable_examples_bin_install"
to install the examples binaries in bin.
Default value is false.
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
examples/meson.build | 13 ++++++++++++-
meson_options.txt | 2 ++
2 files changed, 14 insertions(+), 1 deletion(-)
Comments
On Tue, Aug 06, 2024 at 07:12:16PM +0530, Gagandeep Singh wrote:
> Adding a meson option "enable_examples_bin_install"
> to install the examples binaries in bin.
>
> Default value is false.
>
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> ---
> examples/meson.build | 13 ++++++++++++-
> meson_options.txt | 2 ++
> 2 files changed, 14 insertions(+), 1 deletion(-)
>
Is there a particular reason we might want to do this? Installing sample
code binaries in bin seems rather strange to me.
/Bruce
Hi,
> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, August 6, 2024 7:28 PM
> To: Gagandeep Singh <G.Singh@nxp.com>
> Cc: dev@dpdk.org
> Subject: Re: [v1 1/3] meson: add a meson option to install examples
>
> On Tue, Aug 06, 2024 at 07:12:16PM +0530, Gagandeep Singh wrote:
> > Adding a meson option "enable_examples_bin_install"
> > to install the examples binaries in bin.
> >
> > Default value is false.
> >
> > Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> > ---
> > examples/meson.build | 13 ++++++++++++-
> > meson_options.txt | 2 ++
> > 2 files changed, 14 insertions(+), 1 deletion(-)
> >
> Is there a particular reason we might want to do this? Installing sample code
> binaries in bin seems rather strange to me.
>
Currently, I can see only app binaries are getting installed in bin but not examples binaries. I am not able to
find the particular reason behind this.
The main reason to have the examples in installation directory is to provides a convenient
way for users to explore DPDK's examples without having to manually scan each example build directory and copy them in
their package.
The default behavior remains unchanged.
> /Bruce
07/08/2024 06:09, Gagandeep Singh:
> From: Bruce Richardson <bruce.richardson@intel.com>
> > On Tue, Aug 06, 2024 at 07:12:16PM +0530, Gagandeep Singh wrote:
> > > Adding a meson option "enable_examples_bin_install"
> > > to install the examples binaries in bin.
> > >
> > > Default value is false.
> > >
> > > Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> > > ---
> > > examples/meson.build | 13 ++++++++++++-
> > > meson_options.txt | 2 ++
> > > 2 files changed, 14 insertions(+), 1 deletion(-)
> > >
> > Is there a particular reason we might want to do this? Installing sample code
> > binaries in bin seems rather strange to me.
> >
> Currently, I can see only app binaries are getting installed in bin but not examples binaries. I am not able to
> find the particular reason behind this.
> The main reason to have the examples in installation directory is to provides a convenient
> way for users to explore DPDK's examples without having to manually scan each example build directory and copy them in
> their package.
> The default behavior remains unchanged.
It does not make sense to me.
Examples must be seen as a doc.
We are compiling them mostly to check there is no error.
Running an example should be educational only, no need to install it somewhere else.
I'm afraid this patch is deviating from the intent behind examples.
@@ -124,10 +124,21 @@ foreach example: examples
if allow_experimental_apis
cflags += '-DALLOW_EXPERIMENTAL_API'
endif
- executable('dpdk-' + name, sources,
+ if get_option('enable_examples_bin_install')
+ executable('dpdk-' + name, sources,
+ include_directories: includes,
+ link_whole: link_whole_libs,
+ link_args: ldflags,
+ c_args: cflags,
+ dependencies: dep_objs,
+ install_rpath: join_paths(get_option('prefix'), driver_install_path),
+ install: true)
+ else
+ executable('dpdk-' + name, sources,
include_directories: includes,
link_whole: link_whole_libs,
link_args: ldflags,
c_args: cflags,
dependencies: dep_objs)
+ endif
endforeach
@@ -24,6 +24,8 @@ option('enable_drivers', type: 'string', value: '', description:
'Comma-separated list of drivers to build. If unspecified, build all drivers.')
option('enable_driver_sdk', type: 'boolean', value: false, description:
'Install headers to build drivers.')
+option('enable_examples_bin_install', type: 'boolean', value: false, description:
+ 'Install examples binaries')
option('enable_kmods', type: 'boolean', value: true, description:
'[Deprecated - will be removed in future release] build kernel modules')
option('enable_libs', type: 'string', value: '', description: