meson.build 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. project('build on all', 'c')
  2. py3_mod = import('python3')
  3. py3 = py3_mod.find_python()
  4. executable('fooprog', 'foo.c',
  5. build_by_default : false,
  6. )
  7. executable('barprog', 'foo.c',
  8. build_by_default : false,
  9. build_always : true,
  10. )
  11. comp = files('mygen.py')
  12. checkexists = files('checkexists.py')
  13. mytarget = custom_target('gendat1',
  14. output : 'generated1.dat',
  15. input : 'source.txt',
  16. command : [py3] + comp + ['@INPUT@', '@OUTPUT@'],
  17. build_by_default : true,
  18. )
  19. mytarget = custom_target('gendat2',
  20. output : 'generated2.dat',
  21. input : 'source.txt',
  22. command : [py3] + comp + ['@INPUT@', '@OUTPUT@'],
  23. build_by_default : true,
  24. build_always : false,
  25. )
  26. ct1_output = join_paths(meson.build_root(), 'generated1.dat')
  27. ct2_output = join_paths(meson.build_root(), 'generated2.dat')
  28. exe1_output = join_paths(meson.build_root(), 'fooprog')
  29. exe2_output = join_paths(meson.build_root(), 'barprog')
  30. if host_machine.system() == 'windows'
  31. exe1_output += '.exe'
  32. exe2_output += '.exe'
  33. endif
  34. test('check-build-by-default', py3,
  35. args : [checkexists,
  36. ct1_output, ct2_output, '--not', exe1_output, exe2_output])