summaryrefslogtreecommitdiff
path: root/src/wayland_protocol/meson.build
blob: 5f3680ee93b516c7839b26672d65464fe5d475ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
wayland_scanner_bin = find_program('wayland-scanner')

#make it typo proof
_wayland_protocols = dependency('wayland-protocols')
wayland_client = dependency('wayland-client')

wl_protocol_local = [
  'efl-aux-hints.xml',
  'efl-hints.xml',
  'session-recovery.xml',
  'teamwork.xml',	
  'www.xml'
]

wl_unstable_protocol_sys = [
  join_paths('xdg-shell', 'xdg-shell-unstable-v6.xml'),
  join_paths('linux-dmabuf', 'linux-dmabuf-unstable-v1.xml'),
  join_paths('text-input', 'text-input-unstable-v1.xml'),
]

wl_stable_protocol_sys = [
  join_paths('xdg-shell', 'xdg-shell.xml'),
]

foreach sys_protocol : wl_unstable_protocol_sys
	wl_protocol_local += [ 
		join_paths(_wayland_protocols.get_pkgconfig_variable('pkgdatadir'), 'unstable',
			sys_protocol)]
endforeach

foreach sys_protocol : wl_stable_protocol_sys
  wl_protocol_local += [ 
    join_paths(_wayland_protocols.get_pkgconfig_variable('pkgdatadir'), 'stable',
      sys_protocol)]
endforeach

gen_obj = []

foreach item : wl_protocol_local
  gen_obj += custom_target('wl_code_'+item.underscorify(),
    input: item,
    output : ['@BASENAME@-protocol.c'],
    command: [wayland_scanner_bin, ['code','@INPUT@','@OUTPUT@']]
  )
  gen_obj += custom_target('wl_client_header_'+item.underscorify(),
    input: item,
    output : ['@BASENAME@-client-protocol.h'],
    command: [wayland_scanner_bin, ['client-header','@INPUT@','@OUTPUT@']]
  )
  gen_obj += custom_target('wl_server_header_'+item.underscorify(),
    input: item,
    output : ['@BASENAME@-server-protocol.h'],
    command: [wayland_scanner_bin, ['server-header','@INPUT@','@OUTPUT@']]
  )
endforeach


wayland_protocol_lib = static_library('wayland_protocol',
    gen_obj,
)

wayland_protocol = declare_dependency(
	include_directories: include_directories('.'),
	link_with: wayland_protocol_lib,
  sources: gen_obj,
  dependencies : [wayland_client]
)