Debian Codegraph @

test cases/python/8 different python versions/meson.build

raw
1 project('Python extension module', 'c',
2 default_options : ['buildtype=release'])
3
4 py_mod = import('python')
5
6 py = py_mod.find_installation(get_option('python'), required : false)
7
8 # CI images don't have 32-bit python2 for 32-bit windows,
9 # so this actually gets detected then fails
10 require = not (
11 get_option('python') == 'python2' and
12 host_machine.system() == 'windows' and
13 host_machine.cpu() == 'x86'
14 )
15
16 if py.found()
17 py_dep = py.dependency(required: require)
18
19 if py_dep.found()
20 subdir('ext')
21
22 test('extmod',
23 py,
24 args : files('blaster.py'),
25 env : ['PYTHONPATH=' + pypathdir])
26 else
27 error('MESON_SKIP_TEST: Python libraries not found, skipping test.')
28 endif
29 else
30 error('MESON_SKIP_TEST: Python not found, skipping test.')
31 endif
32
33 py = py_mod.find_installation(get_option('python'), required : get_option('disabled_opt'))
34 assert(not py.found(), 'find_installation not working with disabled feature')