Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libnvme/libnvme/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ if want_python
swig_cmd = [swig, '-python', '-o', '@OUTPUT1@', '@INPUT0@']
endif

py_compat_c_args = []
if not cc.has_header_symbol('Python.h', 'Py_NewRef', dependencies: py3_dep)
warning('Python < 3.10 detected: providing Py_NewRef compatibility shim in nvme.i')
py_compat_c_args = ['-DSWIG_COMPAT_PY_NEWREF']
endif

pymod_swig = custom_target(
'nvme.py',
input: ['nvme.i'],
Expand All @@ -28,6 +34,7 @@ if want_python
pynvme_clib = python3.extension_module(
'_nvme',
nvme_wrap_c,
c_args: py_compat_c_args,
dependencies: [config_dep, ccan_dep, libnvme_dep, py3_dep],
install: true,
subdir: 'libnvme',
Expand Down
Loading
Loading