From ad36c76d353c622c3f9081f5c3dc1b037f778b80 Mon Sep 17 00:00:00 2001 From: Martin Belanger Date: Wed, 1 Mar 2023 14:21:03 -0500 Subject: [PATCH] python, meson: Assert that deps are present for -Dpython=true The -Dpython option takes 3 values: auto, true, or false. For "auto", the Python bindings will be built if all the dependencies are met and will be skipped in not. For "true", the Python bindings MUST be built and therefore missing dependencies need to be treated as an error. For "false", the Python bindings won't be built whether the dependencies are met or not. Currently, with -Dpython=true, if a dependency required to build the Python bindings is missing, meson silently skips it (i.e. it behaves like "-Dpython=auto"). Signed-off-by: Martin Belanger --- libnvme/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnvme/meson.build b/libnvme/meson.build index f83393f4..6a9be2ea 100644 --- a/libnvme/meson.build +++ b/libnvme/meson.build @@ -10,7 +10,7 @@ if want_python != 'false' python3 = import('python').find_installation('python3') py3_dep = python3.dependency(required: want_python == 'true') swig = find_program('swig', required: want_python == 'true') - header_found = cc.has_header('Python.h', dependencies: py3_dep) + header_found = cc.has_header('Python.h', dependencies: py3_dep, required: want_python == 'true') have_python_support = py3_dep.found() and swig.found() and header_found else have_python_support = false -- 2.50.1