[2/3] build: allow to hide dependencies from pkg-config
Checks
Commit Message
If a dependency is required for a driver build,
but should not be exposed to the application (via pkg-config),
it can be declared in the array hidden_deps.
The hidden_deps are used as internal dependencies,
when building the shared library and the first stage of static library.
The final static library does not include the hidden_deps
because this library object is used to generate the .pc file.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/meson.build | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
Comments
On Thu, Jan 16, 2020 at 08:16:55AM +0100, Thomas Monjalon wrote:
> If a dependency is required for a driver build,
> but should not be exposed to the application (via pkg-config),
> it can be declared in the array hidden_deps.
>
> The hidden_deps are used as internal dependencies,
> when building the shared library and the first stage of static library.
> The final static library does not include the hidden_deps
> because this library object is used to generate the .pc file.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> drivers/meson.build | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/meson.build b/drivers/meson.build
> index 3f8749d0b7..4ecd17ee01 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -56,6 +56,7 @@ foreach class:dpdk_driver_classes
> # too, so that it can be reflected in the pkgconfig output for
> # static builds.
> ext_deps = []
> + hidden_deps = []
> pkgconfig_extra_libs = []
>
All parameters for drivers and libs need to be documented in the docs.
Thanks,
/Bruce
@@ -56,6 +56,7 @@ foreach class:dpdk_driver_classes
# too, so that it can be reflected in the pkgconfig output for
# static builds.
ext_deps = []
+ hidden_deps = []
pkgconfig_extra_libs = []
# pull in driver directory which should assign to each of the above
@@ -71,8 +72,9 @@ foreach class:dpdk_driver_classes
endforeach
if build
# get dependency objs from strings
- shared_deps = ext_deps
- static_deps = ext_deps
+ shared_deps = ext_deps + hidden_deps
+ static_deps = ext_deps + hidden_deps
+ static_pub_deps = ext_deps
foreach d:deps
if not is_variable('shared_rte_' + d)
build = false
@@ -82,6 +84,7 @@ foreach class:dpdk_driver_classes
else
shared_deps += [get_variable('shared_rte_' + d)]
static_deps += [get_variable('static_rte_' + d)]
+ static_pub_deps += [get_variable('static_rte_' + d)]
endif
endforeach
endif
@@ -144,7 +147,7 @@ foreach class:dpdk_driver_classes
sources,
objects: objs,
include_directories: includes,
- dependencies: static_deps,
+ dependencies: static_pub_deps, # skip hidden_deps
c_args: cflags,
install: true)