[2/2] net/szedata2: fix dependency check

Message ID 20190914093700.11451-3-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series use pkg-config to find Netcope dependencies |

Checks

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

Commit Message

Thomas Monjalon Sept. 14, 2019, 9:37 a.m. UTC
  The library libsze2 provides a pkg-config file: libsze2.pc.
Looking for this .pc file - with dependency() - is preferred
than looking for the library - with cc.find_library().

If the library is not installed in a standard path,
it can be found thanks to PKG_CONFIG_PATH variable.
The previous solution required to use CFLAGS and LDFLAGS
environment variables.

Fixes: 508cfe6be9f1 ("net/szedata2: add to meson build")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/szedata2/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jan Remes Sept. 15, 2019, 12:05 p.m. UTC | #1
On Sat, Sep 14, 2019 at 11:37 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The library libsze2 provides a pkg-config file: libsze2.pc.
> Looking for this .pc file - with dependency() - is preferred
> than looking for the library - with cc.find_library().
>
> If the library is not installed in a standard path,
> it can be found thanks to PKG_CONFIG_PATH variable.
> The previous solution required to use CFLAGS and LDFLAGS
> environment variables.
>
> Fixes: 508cfe6be9f1 ("net/szedata2: add to meson build")
> Cc: stable@dpdk.org
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Jan Remes <remes@netcope.com>

> ---
>  drivers/net/szedata2/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/szedata2/meson.build b/drivers/net/szedata2/meson.build
> index 032b42518..b53fcbc59 100644
> --- a/drivers/net/szedata2/meson.build
> +++ b/drivers/net/szedata2/meson.build
> @@ -1,7 +1,7 @@
>  # SPDX-License-Identifier: BSD-3-Clause
>  # Copyright(c) 2018 Intel Corporation
>
> -dep = cc.find_library('sze2', required: false)
> +dep = dependency('libsze2', required: false)
>  build = dep.found()
>  reason = 'missing dependency, "libsze2"'
>  ext_deps += dep
> --
> 2.23.0
>
  

Patch

diff --git a/drivers/net/szedata2/meson.build b/drivers/net/szedata2/meson.build
index 032b42518..b53fcbc59 100644
--- a/drivers/net/szedata2/meson.build
+++ b/drivers/net/szedata2/meson.build
@@ -1,7 +1,7 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-dep = cc.find_library('sze2', required: false)
+dep = dependency('libsze2', required: false)
 build = dep.found()
 reason = 'missing dependency, "libsze2"'
 ext_deps += dep