Skip to content

Commit 13cfbf0

Browse files
committed
make limited_api: '3.12' conditional
1 parent e5ae16d commit 13cfbf0

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

meson.build

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,24 @@ nanobind_dep = dependency('nanobind', static: true)
2424
odrpack_dep = dependency('odrpack95', static: true)
2525

2626
# build extension module
27-
nanobind_ext = python.extension_module(
28-
'__odrpack',
29-
'src/odrpack/__odrpack.py.cpp',
30-
dependencies : [python_dep, nanobind_dep, odrpack_dep],
31-
install: true,
32-
limited_api: '3.12',
33-
subdir: 'odrpack'
34-
)
27+
if python.language_version().version_compare('>=3.12')
28+
nanobind_ext = python.extension_module(
29+
'__odrpack',
30+
'src/odrpack/__odrpack.py.cpp',
31+
dependencies : [python_dep, nanobind_dep, odrpack_dep],
32+
install: true,
33+
limited_api: '3.12',
34+
subdir: 'odrpack'
35+
)
36+
else
37+
nanobind_ext = python.extension_module(
38+
'__odrpack',
39+
'src/odrpack/__odrpack.py.cpp',
40+
dependencies : [python_dep, nanobind_dep, odrpack_dep],
41+
install: true,
42+
subdir: 'odrpack'
43+
)
44+
endif
3545

3646
python.install_sources(
3747
[

0 commit comments

Comments
 (0)