meson.build 791 B

1234567891011121314151617181920212223242526272829
  1. project('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. py3_mod = import('python3')
  6. py3 = py3_mod.find_python()
  7. py3_dep = dependency('python3', required : false)
  8. if py3_dep.found()
  9. subdir('ext')
  10. test('extmod',
  11. py3,
  12. args : files('blaster.py'),
  13. env : ['PYTHONPATH=' + pypathdir])
  14. # Check we can apply a version constraint
  15. dependency('python3', version: '>=@0@'.format(py3_dep.version()))
  16. else
  17. error('MESON_SKIP_TEST: Python3 libraries not found, skipping test.')
  18. endif
  19. py3_pkg_dep = dependency('python3', method: 'pkg-config', required : false)
  20. if py3_pkg_dep.found()
  21. python_lib_dir = py3_pkg_dep.get_pkgconfig_variable('libdir')
  22. endif