[1/2] net/mlx5: fix disabling common/mlx5 dependency

Message ID 20221029231712.773630-2-thomas@monjalon.net (mailing list archive)
State Superseded, archived
Delegated to: Raslan Darawsheh
Headers
Series fix build disabling common/mlx5 |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Thomas Monjalon Oct. 29, 2022, 11:17 p.m. UTC
  If the dependency common/mlx5 is explicitly disabled,
but net/mlx5 is not explictly disabled,
Meson will read the full recipe of net/mlx5
and will fail when accessing a variable from common/mlx5:
drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config".

The solution is to stop parsing net/mlx5 if common/mlx5 is disabled.
The deps array must be defined before stopping, in order to automatically
disable the build of net/mlx5 and print the reason.

Fixes: 22681deead3e ("net/mlx5/hws: enable hardware steering")

Reported-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mlx5/meson.build | 4 ++++
 1 file changed, 4 insertions(+)
  

Patch

diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build
index ff84448186..9a8eb0bc19 100644
--- a/drivers/net/mlx5/meson.build
+++ b/drivers/net/mlx5/meson.build
@@ -9,6 +9,10 @@  if not (is_linux or is_windows)
 endif
 
 deps += ['hash', 'common_mlx5']
+if not ('mlx5' in common_drivers)
+    # avoid referencing undefined variables from common/mlx5
+    subdir_done()
+endif
 headers = files('rte_pmd_mlx5.h')
 sources = files(
         'mlx5.c',