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