meson.build 957 B

123456789101112131415161718192021222324252627282930313233343536
  1. project('grabber', 'c')
  2. # What this script does is NOT reliable. Simply adding a file in this directory
  3. # will NOT make it automatically appear in the build. You have to manually
  4. # re-invoke Meson (not just Ninja) for that to happen. The simplest way
  5. # is to touch meson-private/coredata.dat.
  6. # This is not the recommended way to do things, but if the tradeoffs are
  7. # acceptable to you, then we're certainly not going to stop you. Just don't
  8. # file bugs when it fails. :)
  9. if build_machine.system() == 'windows'
  10. c = run_command('grabber.bat')
  11. grabber = find_program('grabber2.bat')
  12. else
  13. c = run_command('grabber.sh')
  14. grabber = find_program('grabber.sh')
  15. endif
  16. # First test running command explicitly.
  17. if c.returncode() != 0
  18. error('Executing script failed.')
  19. endif
  20. newline = '''
  21. '''
  22. sources = c.stdout().strip().split(newline)
  23. e = executable('prog', sources)
  24. test('grabtest', e)
  25. # Then test using program with find_program
  26. subdir('subdir')