> Subject: [PATCH v3 1/3] common/mlx5: get Windows dependency from
> standard variables
> 
> External email: Use caution opening links or attachments
> 
> 
> The DevX library path had to be provided through the variables
> DEVX_INC_PATH and DEVX_LIB_PATH.
> It was non-standard and triggers some issues with recent Meson.
> 
> Using CFLAGS/LDFLAGS is standard and simpler.
> It is also possible to use the Meson options -Dc_args and -Dc_link_args.
> There are 2 options to provide:
>         -I<include_directory>
>         -L<library_directory>
> 
> Signed-off-by: Thomas Monjalon <tho...@monjalon.net>
> ---
>  doc/guides/platform/mlx5.rst            | 11 +++++-----
>  drivers/common/mlx5/windows/meson.build | 28 ++++++++++++------------
> -
>  2 files changed, 20 insertions(+), 19 deletions(-)
> 
> diff --git a/doc/guides/platform/mlx5.rst b/doc/guides/platform/mlx5.rst
> index 2d6fbe7e44..5fc5d0cb8c 100644
> --- a/doc/guides/platform/mlx5.rst
> +++ b/doc/guides/platform/mlx5.rst
> @@ -259,13 +259,14 @@ configured by the ``ibverbs_link`` build option:
>  Compilation on Windows
>  ~~~~~~~~~~~~~~~~~~~~~~
> 
> -The DevX SDK location must be set through two environment variables:
> +The DevX SDK location must be set through CFLAGS/LDFLAGS,
> +either::
> 
> -``DEVX_LIB_PATH``
> -   path to the DevX lib file.
> +   meson.exe setup "-Dc_args=-I\"%DEVX_INC_PATH%\"" "-Dc_link_args=-
> L\"%DEVX_LIB_PATH%\"" ...
> 
> -``DEVX_INC_PATH``
> -   path to the DevX header files.
> +or::
> +
> +   set CFLAGS=-I"%DEVX_INC_PATH%" && set LDFLAGS=-
> L"%DEVX_LIB_PATH%" && meson.exe setup ...
> 
> 
>  .. _mlx5_common_env:
> diff --git a/drivers/common/mlx5/windows/meson.build
> b/drivers/common/mlx5/windows/meson.build
> index cc486014a8..f60daed840 100644
> --- a/drivers/common/mlx5/windows/meson.build
> +++ b/drivers/common/mlx5/windows/meson.build
> @@ -1,6 +1,20 @@
>  # SPDX-License-Identifier: BSD-3-Clause  # Copyright 2019 Mellanox
> Technologies, Ltd
> 
> +if not cc.has_header('mlx5devx.h')
> +    build = false
> +    reason = 'missing dependency, "mlx5devx.h"'
> +    subdir_done()
> +endif
> +
> +devxlib = cc.find_library('mlx5devx', required: true) if not
> +devxlib.found()
> +    build = false
> +    reason = 'missing dependency, "mlx5devx"'
> +    subdir_done()
> +endif
> +ext_deps += devxlib
> +
>  includes += include_directories('.')
> 
>  sources += files(
> @@ -8,20 +22,6 @@ sources += files(
>          'mlx5_common_os.c',
>  )
> 
> -res_lib = run_command(python3, '-c', 'import os;
> print(os.environ["DEVX_LIB_PATH"])', check: false) -res_inc =
> run_command(python3, '-c', 'import os;
> print(os.environ["DEVX_INC_PATH"])', check: false)
> -
> -if (res_lib.returncode() != 0 or res_inc.returncode() != 0)
> -    build = false
> -    reason = 'DevX environment variables are not set, DEVX_LIB_PATH and
> DEVX_INC_PATH vars must be exported'
> -    subdir_done()
> -endif
> -
> -devx_lib_dir = res_lib.stdout().strip() -devx_inc_dir =
> res_inc.stdout().strip()
> -
> -ext_deps += cc.find_library('mlx5devx', dirs: devx_lib_dir, required: true) -
> includes += include_directories(devx_inc_dir)  cflags_options = [
>          '-std=c11',
>          '-Wno-strict-prototypes',
> --
> 2.39.1

Acked-by: Tal Shnaiderman <tal...@nvidia.com>

Reply via email to