| 1 |
project('cython_args', ['cython', 'c'], |
| 2 |
# Needed because Windows Python builds are release-only and tend to be |
| 3 |
# unhappy with a debug build type. |
| 4 |
default_options : ['buildtype=release'] |
| 5 |
) |
| 6 |
|
| 7 |
if meson.backend() != 'ninja' |
| 8 |
error('MESON_SKIP_TEST: Ninja backend required') |
| 9 |
endif |
| 10 |
|
| 11 |
python = import('python').find_installation('python3') |
| 12 |
python_dep = python.dependency() |
| 13 |
if not python_dep.found() |
| 14 |
error('MESON_SKIP_TEST: Python library not found.') |
| 15 |
endif |
| 16 |
|
| 17 |
mod = python.extension_module( |
| 18 |
'cythonargs', |
| 19 |
files('cythonargs.pyx'), |
| 20 |
cython_args: [ |
| 21 |
'--compile-time-env', |
| 22 |
'VALUE=1', |
| 23 |
'-3', |
| 24 |
], |
| 25 |
) |
| 26 |
|
| 27 |
test( |
| 28 |
'test', |
| 29 |
python, |
| 30 |
args: [ |
| 31 |
'test.py' |
| 32 |
], |
| 33 |
workdir: meson.current_source_dir(), |
| 34 |
env: environment({ |
| 35 |
'PYTHONPATH': meson.current_build_dir(), |
| 36 |
}) |
| 37 |
) |