#
# Authors: Martin Belanger <Martin.Belanger@dell.com>
#
-python3 = import('python').find_installation('python3')
-swig = find_program('swig', required: false)
-if swig.found()
+
+want_python = get_option('python')
+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')
+ have_python_support = py3_dep.found() and swig.found()
+else
+ have_python_support = false
+endif
+
+if have_python_support
pymod_swig = custom_target(
'nvme.py',
- input: ['nvme.i', config_h],
+ input: ['nvme.i', config_host_h, ccan_config_h],
output: ['nvme.py', 'nvme_wrap.c'],
command: [swig, '-python', '-py3', '-o', '@OUTPUT1@', '@INPUT0@'],
install: true,