meson.build 860 B

12345678910111213141516171819202122232425262728
  1. project('sdl2 test', 'c')
  2. sdl2_dep = dependency('sdl2', version : '>=2.0.0', required: false)
  3. if not sdl2_dep.found()
  4. error('MESON_SKIP_TEST sdl2 not found.')
  5. endif
  6. e = executable('sdl2prog', 'sdl2prog.c', dependencies : sdl2_dep)
  7. test('sdl2test', e)
  8. if sdl2_dep.type_name() == 'extraframeworks'
  9. # The SDL OSX framework does not ship with detection executables
  10. # so skip the remaining tests.
  11. subdir_done()
  12. endif
  13. # Ensure that we can find it with sdl2-config too, using the legacy method name
  14. configdep = dependency('sdl2', method : 'sdlconfig')
  15. # And the modern method name
  16. configdep = dependency('sdl2', method : 'config-tool')
  17. # Check we can apply a version constraint
  18. dependency('sdl2', version: '>=@0@'.format(sdl2_dep.version()), method: 'pkg-config')
  19. dependency('sdl2', version: '>=@0@'.format(sdl2_dep.version()), method: 'config-tool')