meson.build 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. tester_sources = files(
  2. 'tester.c',
  3. 'common.c',
  4. 'buffers.c',
  5. )
  6. cc = meson.get_compiler('c')
  7. wl_req = '>= 1.15'
  8. wl_scanner = find_program('wayland-scanner')
  9. drm_dep = dependency('libdrm')
  10. rt_dep = cc.find_library('rt', required: false)
  11. wl_client_dep = dependency('wayland-client', version: wl_req)
  12. wl_protocol_dep = dependency('wayland-protocols', version: wl_req)
  13. protocols_datadir = wl_protocol_dep.get_pkgconfig_variable('pkgdatadir')
  14. protocol_defs = [
  15. ['/stable/viewporter/viewporter.xml', 'viewporter-protocol.c', 'viewporter-client-protocol.h'],
  16. ['/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml',
  17. 'linux-dmabuf-unstable-v1-protocol.c', 'linux-dmabuf-unstable-v1-client-protocol.h'],
  18. ['/unstable/xdg-output/xdg-output-unstable-v1.xml',
  19. 'xdg-output-unstable-v1-protocol.c', 'xdg-output-unstable-v1-client-protocol.h'],
  20. ['/stable/xdg-shell/xdg-shell.xml', 'xdg-shell-protocol.c', 'xdg-shell-client-protocol.h'],
  21. ]
  22. protocols_files = []
  23. foreach protodef: protocol_defs
  24. xmlfile = protocols_datadir + protodef.get(0)
  25. protocols_files += [custom_target(protodef.get(1),
  26. output : protodef.get(1),
  27. input : xmlfile,
  28. command : [wl_scanner, 'code', '@INPUT@', '@OUTPUT@'])]
  29. protocols_files += [custom_target(protodef.get(2),
  30. output : protodef.get(2),
  31. input : xmlfile,
  32. command : [wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'])]
  33. endforeach
  34. dep_common = [drm_dep, rt_dep, wl_client_dep, wl_protocol_dep]
  35. wl_tester = executable('wl-tester', tester_sources + protocols_files, dependencies : dep_common, install : true)