Skip to content

Commit ad36c76

Browse files
Martin Belangerigaw
authored andcommitted
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 <[email protected]>
1 parent 2064caf commit ad36c76

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libnvme/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if want_python != 'false'
1010
python3 = import('python').find_installation('python3')
1111
py3_dep = python3.dependency(required: want_python == 'true')
1212
swig = find_program('swig', required: want_python == 'true')
13-
header_found = cc.has_header('Python.h', dependencies: py3_dep)
13+
header_found = cc.has_header('Python.h', dependencies: py3_dep, required: want_python == 'true')
1414
have_python_support = py3_dep.found() and swig.found() and header_found
1515
else
1616
have_python_support = false

0 commit comments

Comments
 (0)