1project('Python extension module', 'c', 2 default_options : ['buildtype=release']) 3# Because Windows Python ships only with optimized libs, 4# we must build this project the same way. 5 6if meson.backend() != 'ninja' 7 error('MESON_SKIP_TEST: Ninja backend required') 8endif 9 10 11py_mod = import('python') 12py = py_mod.find_installation() 13py_dep = py.dependency(required: false) 14 15if not py_dep.found() 16 error('MESON_SKIP_TEST: Python libraries not found.') 17endif 18 19subdir('ext') 20 21blaster = configure_file( 22 input: 'blaster.py.in', 23 output: 'blaster.py', 24 configuration: {'tachyon_module': 'tachyon'} 25) 26 27test('extmod', 28 py, 29 args : blaster, 30 env : ['PYTHONPATH=' + pypathdir]) 31 32py.install_sources(blaster, pure: false) 33py.install_sources(blaster, subdir: 'pure') 34 35py3_pkg_dep = dependency('python3', method: 'pkg-config', required : false) 36if py3_pkg_dep.found() 37 python_lib_dir = py3_pkg_dep.get_pkgconfig_variable('libdir') 38 39 # Check we can apply a version constraint 40 dependency('python3', version: '>=@0@'.format(py_dep.version())) 41else 42 message('Skipped python3 pkg-config test') 43endif 44