d9a9410b2220378f73b6720b24c75d74b6ca254a
[platform/core/uifw/libds.git] / src / meson.build
1 libds_files = [
2   'log.c',
3   'addon.c',
4   'buffer.c',
5   'allocator.c',
6   'swapchain.c',
7   'output.c',
8   'region.c',
9   'util/time.c',
10   'util/shm.c',
11   'util/box.c',
12   'util/transform.c',
13   'compositor/compositor.c',
14   'compositor/subcompositor.c',
15   'compositor/surface.c',
16   'compositor/subsurface.c',
17   'client_buffer/shm_client_buffer.c',
18   'client_buffer/single_pixel_buffer_v1.c',
19   'xdg_shell/xdg_shell.c',
20   'xdg_shell/xdg_surface.c',
21   'xdg_shell/xdg_toplevel.c',
22   'pixel_format.c',
23   'backend.c',
24   'input_device/input_device.c',
25   'input_device/pointer.c',
26   'input_device/keyboard.c',
27   'input_device/touch.c',
28   'seat/seat.c',
29   'seat/seat_pointer.c',
30   'seat/seat_keyboard.c',
31   'seat/seat_touch.c',
32   'shell.c',
33   'shell_surface.c',
34 ]
35
36 protocols = {
37   'xdg-shell': wl_protocol_dir / 'stable/xdg-shell/xdg-shell.xml',
38   'single-pixel-buffer-v1': wl_protocol_dir / 'staging/single-pixel-buffer/single-pixel-buffer-v1.xml',
39 }
40
41 protocols_code = {}
42 protocols_server_header = {}
43
44 foreach name, path : protocols
45   code = custom_target(
46     name.underscorify() + '_c',
47     input: path,
48     output: '@BASENAME@-protocol.c',
49     command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
50   )
51   libds_files += code
52
53   server_header = custom_target(
54     name.underscorify() + '_server_h',
55     input: path,
56     output: '@BASENAME@-server-protocol.h',
57     command: [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'],
58     build_by_default: false,
59   )
60   libds_files += server_header
61 endforeach
62
63 math = meson.get_compiler('c').find_library('m')
64 wayland_server = dependency('wayland-server', required: true)
65 pixman = dependency('pixman-1', required: true)
66 libdrm = dependency('libdrm', required: true)
67 xkbcommon = dependency('xkbcommon', required: true)
68 rt = meson.get_compiler('c').find_library('rt')
69
70 if wayland_server.version().version_compare('>= 1.19')
71   cdata.set('HAVE_WL_SEAT_ERROR_MISSING_CAPABILITY', '1')
72 endif
73
74 libds_deps = [
75   math,
76   wayland_server,
77   pixman,
78   libdrm,
79   xkbcommon,
80   rt,
81 ]
82
83 subdir('backend')
84 subdir('allocator')
85 subdir('data_device')
86
87 lib_libds = shared_library('ds', libds_files,
88   dependencies: libds_deps,
89   include_directories: [ common_inc, include_directories('.') ],
90   version: meson.project_version(),
91   install: true
92 )
93
94 dep_libds = declare_dependency(
95   link_with: lib_libds,
96   dependencies: libds_deps,
97   include_directories: [ common_inc, include_directories('.') ],
98 )
99
100 pkgconfig = import('pkgconfig')
101 pkgconfig.generate(lib_libds,
102   version: meson.project_version(),
103   filebase: meson.project_name(),
104   name: meson.project_name(),
105   description: 'Wayland compositor library',
106 )
107
108 subdir('xdg_shell_v6')