5301adbe7184874f4726ba7e70b3e06c69010323
[platform/upstream/efl.git] / src / wayland_protocol / meson.build
1 wayland_scanner_bin = find_program('wayland-scanner')
2
3 #make it typo proof
4 _wayland_protocols = dependency('wayland-protocols')
5 wayland_client = dependency('wayland-client')
6
7 wl_protocol_local = [
8   'efl-aux-hints.xml',
9   'efl-hints.xml',
10   'session-recovery.xml',
11   'teamwork.xml',       
12   'www.xml'
13 ]
14
15 wl_unstable_protocol_sys = [
16   join_paths('xdg-shell', 'xdg-shell-unstable-v6.xml'),
17   join_paths('linux-dmabuf', 'linux-dmabuf-unstable-v1.xml'),
18   join_paths('text-input', 'text-input-unstable-v1.xml'),
19 ]
20
21 wl_stable_protocol_sys = [
22   join_paths('xdg-shell', 'xdg-shell.xml'),
23 ]
24
25 foreach sys_protocol : wl_unstable_protocol_sys
26         wl_protocol_local += [
27                 join_paths(_wayland_protocols.get_pkgconfig_variable('pkgdatadir'), 'unstable',
28                         sys_protocol)]
29 endforeach
30
31 foreach sys_protocol : wl_stable_protocol_sys
32   wl_protocol_local += [
33     join_paths(_wayland_protocols.get_pkgconfig_variable('pkgdatadir'), 'stable',
34       sys_protocol)]
35 endforeach
36
37 gen_obj_c = []
38 gen_obj_header = []
39
40 foreach item : wl_protocol_local
41   gen_obj_c += custom_target('wl_code_'+item.underscorify(),
42     input: item,
43     output : ['@BASENAME@-protocol.c'],
44     command: [wayland_scanner_bin, ['code','@INPUT@','@OUTPUT@']]
45   )
46   gen_obj_header += custom_target('wl_client_header_'+item.underscorify(),
47     input: item,
48     output : ['@BASENAME@-client-protocol.h'],
49     command: [wayland_scanner_bin, ['client-header','@INPUT@','@OUTPUT@']]
50   )
51   gen_obj_header += custom_target('wl_server_header_'+item.underscorify(),
52     input: item,
53     output : ['@BASENAME@-server-protocol.h'],
54     command: [wayland_scanner_bin, ['server-header','@INPUT@','@OUTPUT@']]
55   )
56 endforeach
57
58
59 wayland_protocol_lib = static_library('wayland_protocol',
60     gen_obj_c + gen_obj_header,
61 )
62
63 wayland_protocol = declare_dependency(
64         include_directories: include_directories('.'),
65         link_with: wayland_protocol_lib,
66   sources: gen_obj_header,
67   dependencies : [wayland_client]
68 )