Use release buildtype in Cython tests, and skip unless ninja backend
This matches the tests for Python extensions. Also include some other cleanups to these `meson.build` files: Adding `python_dep` is no longer needed, this is automatic now. Use a single line for `import('python').find_installation()`, because the result of `import('python')` by itself is not used for anything.
This commit is contained in:
parent
a95ebf1077
commit
91c7e79519
|
@ -1,11 +1,14 @@
|
|||
project(
|
||||
'basic cython project',
|
||||
['cython', 'c'],
|
||||
default_options : ['warning_level=3']
|
||||
default_options : ['warning_level=3', 'buildtype=release'],
|
||||
)
|
||||
|
||||
py_mod = import('python')
|
||||
py3 = py_mod.find_installation()
|
||||
if meson.backend() != 'ninja'
|
||||
error('MESON_SKIP_TEST: Ninja backend required')
|
||||
endif
|
||||
|
||||
py3 = import('python').find_installation()
|
||||
py3_dep = py3.dependency(required : false)
|
||||
if not py3_dep.found()
|
||||
error('MESON_SKIP_TEST: Python library not found.')
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
project(
|
||||
'generated cython sources',
|
||||
['cython'],
|
||||
default_options : ['buildtype=release'],
|
||||
)
|
||||
|
||||
py_mod = import('python')
|
||||
py3 = py_mod.find_installation('python3')
|
||||
py3_dep = py3.dependency(required : false)
|
||||
if meson.backend() != 'ninja'
|
||||
error('MESON_SKIP_TEST: Ninja backend required')
|
||||
endif
|
||||
|
||||
fs = import('fs')
|
||||
py3 = import('python').find_installation('python3')
|
||||
py3_dep = py3.dependency(required : false)
|
||||
if not py3_dep.found()
|
||||
error('MESON_SKIP_TEST: Python library not found.')
|
||||
endif
|
||||
|
@ -18,7 +22,7 @@ ct = custom_target(
|
|||
command : [py3, '@INPUT@', '@OUTPUT@'],
|
||||
)
|
||||
|
||||
ct_ext = py3.extension_module('ct', ct, dependencies : py3_dep)
|
||||
ct_ext = py3.extension_module('ct', ct)
|
||||
|
||||
test(
|
||||
'custom target',
|
||||
|
@ -35,7 +39,7 @@ cti = custom_target(
|
|||
command : [py3, '@INPUT@', '@OUTPUT@'],
|
||||
)
|
||||
|
||||
cti_ext = py3.extension_module('cti', cti[0], dependencies : py3_dep)
|
||||
cti_ext = py3.extension_module('cti', cti[0])
|
||||
|
||||
cf = configure_file(
|
||||
input : 'configure.pyx.in',
|
||||
|
@ -43,7 +47,7 @@ cf = configure_file(
|
|||
copy : true,
|
||||
)
|
||||
|
||||
cf_ext = py3.extension_module('cf', cf, dependencies : py3_dep)
|
||||
cf_ext = py3.extension_module('cf', cf)
|
||||
|
||||
test(
|
||||
'configure file',
|
||||
|
@ -61,7 +65,6 @@ gen = generator(
|
|||
g_ext = py3.extension_module(
|
||||
'g',
|
||||
gen.process('g.in'),
|
||||
dependencies : py3_dep,
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
project('cython_args', ['cython', 'c'])
|
||||
project('cython_args', ['cython', 'c'],
|
||||
# Needed because Windows Python builds are release-only and tend to be
|
||||
# unhappy with a debug build type.
|
||||
default_options : ['buildtype=release']
|
||||
)
|
||||
|
||||
pymod = import('python')
|
||||
python = pymod.find_installation('python3')
|
||||
if meson.backend() != 'ninja'
|
||||
error('MESON_SKIP_TEST: Ninja backend required')
|
||||
endif
|
||||
|
||||
python = import('python').find_installation('python3')
|
||||
python_dep = python.dependency()
|
||||
if not python_dep.found()
|
||||
error('MESON_SKIP_TEST: Python library not found.')
|
||||
|
@ -12,9 +19,9 @@ mod = python.extension_module(
|
|||
files('cythonargs.pyx'),
|
||||
cython_args: [
|
||||
'--compile-time-env',
|
||||
'VALUE=1'
|
||||
'VALUE=1',
|
||||
'-3',
|
||||
],
|
||||
dependencies: [python_dep]
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
pyx_c = custom_target('storer_pyx',
|
||||
output : 'storer_pyx.c',
|
||||
input : 'storer.pyx',
|
||||
command : [cython, '@INPUT@', '-o', '@OUTPUT@'],
|
||||
command : [cython, '@INPUT@', '-o', '@OUTPUT@', '-3'],
|
||||
)
|
||||
|
||||
slib = py3.extension_module('storer',
|
||||
'storer.c', pyx_c,
|
||||
dependencies : py3_dep)
|
||||
)
|
||||
|
||||
pydir = meson.current_build_dir()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
project('cython', 'c',
|
||||
default_options : ['warning_level=3'])
|
||||
|
||||
default_options : ['warning_level=3', 'buildtype=release']
|
||||
)
|
||||
if meson.backend() != 'ninja'
|
||||
error('MESON_SKIP_TEST: Ninja backend required')
|
||||
endif
|
||||
|
@ -10,8 +10,7 @@ if not cython.found()
|
|||
error('MESON_SKIP_TEST: Cython3 not found.')
|
||||
endif
|
||||
|
||||
py_mod = import('python')
|
||||
py3 = py_mod.find_installation()
|
||||
py3 = import('python').find_installation(pure: false)
|
||||
py3_dep = py3.dependency(required: false)
|
||||
if not py3_dep.found()
|
||||
error('MESON_SKIP_TEST: Python library not found.')
|
||||
|
|
Loading…
Reference in New Issue