meson.build 883 B

1234567891011121314151617181920212223242526272829303132333435
  1. project('custom target', 'c')
  2. python = find_program('python3', required : false)
  3. if not python.found()
  4. python = find_program('python')
  5. endif
  6. # files() is the correct way to do this, but some people
  7. # do this so test that it works.
  8. comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py')
  9. comp2 = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler2.py')
  10. infile = files('data_source.txt')[0]
  11. mytarget = custom_target('bindat',
  12. output : 'data.dat',
  13. command : [python, comp, infile, '@OUTPUT@'],
  14. )
  15. mytarget2 = custom_target('bindat2',
  16. output : 'data2.dat',
  17. command : [python, comp2, mytarget, '@OUTPUT@'],
  18. install : true,
  19. install_dir : 'subdir'
  20. )
  21. mytarget3 = custom_target('bindat3',
  22. output : 'data3.dat',
  23. input : [mytarget],
  24. command : [python, comp2, '@INPUT@', '@OUTPUT@'],
  25. install : true,
  26. install_dir : 'subdir'
  27. )
  28. subdir('usetarget')