meson.build 697 B

123456789101112131415161718192021222324252627
  1. project('Python extension module', 'c',
  2. default_options : ['buildtype=release'])
  3. py_mod = import('python')
  4. py = py_mod.find_installation(get_option('python'), required : false)
  5. if py.found()
  6. py_dep = py.dependency()
  7. if py_dep.found()
  8. subdir('ext')
  9. test('extmod',
  10. py,
  11. args : files('blaster.py'),
  12. env : ['PYTHONPATH=' + pypathdir])
  13. else
  14. error('MESON_SKIP_TEST: Python libraries not found, skipping test.')
  15. endif
  16. else
  17. error('MESON_SKIP_TEST: Python not found, skipping test.')
  18. endif
  19. py = py_mod.find_installation(get_option('python'), required : get_option('disabled_opt'))
  20. assert(not py.found(), 'find_installation not working with disabled feature')