meson.build 643 B

123456789101112131415161718192021222324252627
  1. project('python sample', 'c')
  2. py_mod = import('python')
  3. py = py_mod.find_installation()
  4. py_version = py.language_version()
  5. if py_version.version_compare('< 3.2')
  6. error('MESON_SKIP_TEST python 3 required for tests')
  7. endif
  8. py_purelib = py.get_path('purelib')
  9. if not py_purelib.endswith('site-packages')
  10. error('Python3 purelib path seems invalid? ' + py_purelib)
  11. endif
  12. # could be 'lib64' or 'Lib' on some systems
  13. py_platlib = py.get_path('platlib')
  14. if not py_platlib.endswith('site-packages')
  15. error('Python3 platlib path seems invalid? ' + py_platlib)
  16. endif
  17. main = files('prog.py')
  18. test('toplevel', py, args : main)
  19. subdir('subdir')