From: Martin Belanger Date: Wed, 1 Mar 2023 19:21:03 +0000 (-0500) Subject: python, meson: Assert that deps are present for -Dpython=true X-Git-Tag: v1.4~27 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ad36c76d353c622c3f9081f5c3dc1b037f778b80;p=users%2Fsagi%2Flibnvme.git 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 --- 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