meson.build 910 B

123456789101112131415161718192021222324252627282930313233
  1. project('python sample', 'c')
  2. py3_mod = import('python3')
  3. py3 = py3_mod.find_python()
  4. py3_version = py3_mod.language_version()
  5. if py3_version.version_compare('< 3.2')
  6. error('Invalid python version!?')
  7. endif
  8. py3_purelib = py3_mod.sysconfig_path('purelib')
  9. if not py3_purelib.to_lower().startswith('lib') or not py3_purelib.endswith('site-packages')
  10. error('Python3 purelib path seems invalid?')
  11. endif
  12. # could be 'lib64' or 'Lib' on some systems
  13. py3_platlib = py3_mod.sysconfig_path('platlib')
  14. if not py3_platlib.to_lower().startswith('lib') or not py3_platlib.endswith('site-packages')
  15. error('Python3 platlib path seems invalid?')
  16. endif
  17. # could be 'Include' on Windows
  18. py3_include = py3_mod.sysconfig_path('include')
  19. if not py3_include.to_lower().startswith('include')
  20. error('Python3 include path seems invalid?')
  21. endif
  22. main = files('prog.py')
  23. test('toplevel', py3, args : main)
  24. subdir('subdir')