blob: 0c41b99d4d673ad6e5541cae94c41ba46be2e37b [file] [log] [blame]
Daniel Stone8011b0f2016-11-24 15:54:51 +00001srcs_weston = [
2 git_version_h,
3 'main.c',
4 'text-backend.c',
5 'weston-screenshooter.c',
6 text_input_unstable_v1_server_protocol_h,
7 text_input_unstable_v1_protocol_c,
8 input_method_unstable_v1_server_protocol_h,
9 input_method_unstable_v1_protocol_c,
10 weston_screenshooter_server_protocol_h,
11 weston_screenshooter_protocol_c,
12]
13deps_weston = [
14 dep_libshared,
Pekka Paalanen71ff95a2019-04-18 16:43:55 +030015 dep_libweston_public,
Daniel Stone8011b0f2016-11-24 15:54:51 +000016 dep_libinput,
Eric Toombs6e229ca2019-01-31 21:53:25 -050017 dep_libevdev,
Daniel Stone8011b0f2016-11-24 15:54:51 +000018 dep_libdl,
19 dep_threads,
limin.tian531dd232025-01-07 12:09:27 +000020 dep_liblog,
Daniel Stone8011b0f2016-11-24 15:54:51 +000021]
22
23if get_option('xwayland')
Philipp Zabelb68847a2019-02-13 15:59:59 +010024 config_h.set('BUILD_XWAYLAND', '1')
25
Daniel Stone8011b0f2016-11-24 15:54:51 +000026 srcs_weston += 'xwayland.c'
27 config_h.set_quoted('XSERVER_PATH', get_option('xwayland-path'))
28endif
29
Pekka Paalanenb35c21f2019-07-08 17:12:41 +030030libexec_weston = shared_library(
31 'exec_weston',
32 sources: srcs_weston,
33 include_directories: common_inc,
34 dependencies: deps_weston,
35 install_dir: dir_module_weston,
36 install: true,
37 version: '0.0.0',
38 soversion: 0
39)
40dep_libexec_weston = declare_dependency(
41 link_with: libexec_weston,
42 include_directories: [ include_directories('.'), public_inc ],
43 dependencies: dep_libweston_public
44)
Daniel Stone8011b0f2016-11-24 15:54:51 +000045exe_weston = executable(
46 'weston',
Pekka Paalanenb35c21f2019-07-08 17:12:41 +030047 'executable.c',
Pekka Paalanen4f5e3602019-04-05 17:09:28 +030048 include_directories: common_inc,
Pekka Paalanenb35c21f2019-07-08 17:12:41 +030049 dependencies: dep_libexec_weston,
50 install_rpath: dir_module_weston,
Daniel Stone8011b0f2016-11-24 15:54:51 +000051 install: true
52)
53install_headers('weston.h', subdir: 'weston')
54
55pkgconfig.generate(
56 filebase: 'weston',
57 name: 'Weston Plugin API',
58 version: version_weston,
59 description: 'Header files for Weston plugin development',
60 requires_private: [ lib_weston ],
61 variables: [
62 'libexecdir=' + join_paths('${prefix}', get_option('libexecdir')),
63 'pkglibexecdir=${libexecdir}/weston'
64 ],
65 subdirs: 'weston'
66)
67
68install_data(
69 'weston.desktop',
70 install_dir: join_paths(dir_data, 'wayland-sessions')
71)
72
73if get_option('screenshare')
74 srcs_screenshare = [
75 'screen-share.c',
76 fullscreen_shell_unstable_v1_client_protocol_h,
77 fullscreen_shell_unstable_v1_protocol_c,
78 ]
79 deps_screenshare = [
Pekka Paalanen8e7f9502019-07-09 12:00:41 +030080 dep_libexec_weston,
Stefan Agner483c6d42019-03-20 00:09:51 +010081 dep_libshared,
Pekka Paalanen71ff95a2019-04-18 16:43:55 +030082 dep_libweston_public,
83 dep_libweston_private_h, # XXX: https://gitlab.freedesktop.org/wayland/weston/issues/292
Daniel Stone8011b0f2016-11-24 15:54:51 +000084 dep_wayland_client,
85 ]
86 plugin_screenshare = shared_library(
87 'screen-share',
88 srcs_screenshare,
Pekka Paalanen4f5e3602019-04-05 17:09:28 +030089 include_directories: common_inc,
Daniel Stone8011b0f2016-11-24 15:54:51 +000090 dependencies: deps_screenshare,
91 name_prefix: '',
92 install: true,
Philipp Zabel4b1de012020-02-05 00:40:01 +010093 install_dir: dir_module_weston,
94 install_rpath: '$ORIGIN'
Daniel Stone8011b0f2016-11-24 15:54:51 +000095 )
96 env_modmap += 'screen-share.so=@0@;'.format(plugin_screenshare.full_path())
97endif
98
99if get_option('color-management-lcms')
100 config_h.set('HAVE_LCMS', '1')
101
102 srcs_lcms = [
103 'cms-static.c',
104 'cms-helper.c',
105 ]
Pekka Paalanen37dabe52018-12-31 14:17:23 +0200106
107 dep_lcms2 = dependency('lcms2', required: false)
108 if not dep_lcms2.found()
109 error('cms-static requires lcms2 which was not found. Or, you can use \'-Dcolor-management-lcms=false\'.')
110 endif
111
Daniel Stone8011b0f2016-11-24 15:54:51 +0000112 plugin_lcms = shared_library(
113 'cms-static',
114 srcs_lcms,
Pekka Paalanen4f5e3602019-04-05 17:09:28 +0300115 include_directories: common_inc,
Pekka Paalanen8e7f9502019-07-09 12:00:41 +0300116 dependencies: [ dep_libexec_weston, dep_libweston_public, dep_lcms2 ],
Daniel Stone8011b0f2016-11-24 15:54:51 +0000117 name_prefix: '',
118 install: true,
Philipp Zabel4b1de012020-02-05 00:40:01 +0100119 install_dir: dir_module_weston,
120 install_rpath: '$ORIGIN'
Daniel Stone8011b0f2016-11-24 15:54:51 +0000121 )
122 env_modmap += 'cms-static.so=@0@;'.format(plugin_lcms.full_path())
123endif
124
125if get_option('color-management-colord')
126 if not get_option('color-management-lcms')
Emmanuel Gil Peyrot5b5decb2021-02-11 23:44:20 +0100127 error('LCMS must be enabled to support colord. Or, you can use \'-Dcolor-management-colord=false\'.')
Daniel Stone8011b0f2016-11-24 15:54:51 +0000128 endif
129
130 srcs_colord = [
131 'cms-colord.c',
132 'cms-helper.c',
133 ]
Pekka Paalanen217a15c2018-12-31 14:20:40 +0200134
135 dep_colord = dependency('colord', version: '>= 0.1.27', required: false)
136 if not dep_colord.found()
137 error('cms-colord requires colord >= 0.1.27 which was not found. Or, you can use \'-Dcolor-management-colord=false\'.')
138 endif
139
Guillaume Champagne7451f992020-06-01 21:59:12 -0400140 plugin_colord_deps = [ dep_libweston_public, dep_colord, dep_lcms2 ]
Pekka Paalanen191c4532019-03-22 14:20:51 +0200141
142 foreach depname : [ 'glib-2.0', 'gobject-2.0' ]
143 dep = dependency(depname, required: false)
144 if not dep.found()
145 error('cms-colord requires \'@0@\' which was not found. If you rather not build this, set \'-Dcolor-management-colord=false\'.'.format(depname))
146 endif
147 plugin_colord_deps += dep
148 endforeach
149
Daniel Stone8011b0f2016-11-24 15:54:51 +0000150 plugin_colord = shared_library(
151 'cms-colord',
152 srcs_colord,
Pekka Paalanen4f5e3602019-04-05 17:09:28 +0300153 include_directories: common_inc,
Pekka Paalanen191c4532019-03-22 14:20:51 +0200154 dependencies: plugin_colord_deps,
Daniel Stone8011b0f2016-11-24 15:54:51 +0000155 name_prefix: '',
156 install: true,
157 install_dir: dir_module_weston
158 )
159 env_modmap += 'cms-colord.so=@0@;'.format(plugin_colord.full_path())
160endif
161
162if get_option('systemd')
Pekka Paalanend64649b2018-12-31 14:23:59 +0200163 dep_libsystemd = dependency('libsystemd', required: false)
164 if not dep_libsystemd.found()
165 error('systemd-notify requires libsystemd which was not found. Or, you can use \'-Dsystemd=false\'.')
166 endif
167
Daniel Stone8011b0f2016-11-24 15:54:51 +0000168 plugin_systemd_notify = shared_library(
169 'systemd-notify',
170 'systemd-notify.c',
Pekka Paalanen4f5e3602019-04-05 17:09:28 +0300171 include_directories: common_inc,
Pekka Paalanen71ff95a2019-04-18 16:43:55 +0300172 dependencies: [ dep_libweston_public, dep_libsystemd ],
Daniel Stone8011b0f2016-11-24 15:54:51 +0000173 name_prefix: '',
174 install: true,
175 install_dir: dir_module_weston
176 )
177 env_modmap += 'systemd-notify.so=@0@;'.format(plugin_systemd_notify.full_path())
178endif
179
leng.fang32af9fc2024-06-13 11:22:15 +0800180config_h.set('AML_MAX_OUTPUT_PIPLINE', get_option('WESTON_MAX_OUTPUT_PIPLINE'))
181config_h.set('HAVE_GBM_MODIFIERS', get_option('WESTON_HAVE_GBM_MODIFIERS'))
182
Daniel Stone8011b0f2016-11-24 15:54:51 +0000183weston_ini_config = configuration_data()
184weston_ini_config.set('bindir', dir_bin)
185weston_ini_config.set('libexecdir', dir_libexec)
Daniel Stone8011b0f2016-11-24 15:54:51 +0000186configure_file(
187 input: '../weston.ini.in',
188 output: 'weston.ini',
189 configuration: weston_ini_config
190)