Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 1 | srcs_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 | ] |
| 13 | deps_weston = [ |
| 14 | dep_libshared, |
Pekka Paalanen | 71ff95a | 2019-04-18 16:43:55 +0300 | [diff] [blame] | 15 | dep_libweston_public, |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 16 | dep_libinput, |
Eric Toombs | 6e229ca | 2019-01-31 21:53:25 -0500 | [diff] [blame] | 17 | dep_libevdev, |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 18 | dep_libdl, |
| 19 | dep_threads, |
limin.tian | 531dd23 | 2025-01-07 12:09:27 +0000 | [diff] [blame] | 20 | dep_liblog, |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 21 | ] |
| 22 | |
| 23 | if get_option('xwayland') |
Philipp Zabel | b68847a | 2019-02-13 15:59:59 +0100 | [diff] [blame] | 24 | config_h.set('BUILD_XWAYLAND', '1') |
| 25 | |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 26 | srcs_weston += 'xwayland.c' |
| 27 | config_h.set_quoted('XSERVER_PATH', get_option('xwayland-path')) |
| 28 | endif |
| 29 | |
Pekka Paalanen | b35c21f | 2019-07-08 17:12:41 +0300 | [diff] [blame] | 30 | libexec_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 | ) |
| 40 | dep_libexec_weston = declare_dependency( |
| 41 | link_with: libexec_weston, |
| 42 | include_directories: [ include_directories('.'), public_inc ], |
| 43 | dependencies: dep_libweston_public |
| 44 | ) |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 45 | exe_weston = executable( |
| 46 | 'weston', |
Pekka Paalanen | b35c21f | 2019-07-08 17:12:41 +0300 | [diff] [blame] | 47 | 'executable.c', |
Pekka Paalanen | 4f5e360 | 2019-04-05 17:09:28 +0300 | [diff] [blame] | 48 | include_directories: common_inc, |
Pekka Paalanen | b35c21f | 2019-07-08 17:12:41 +0300 | [diff] [blame] | 49 | dependencies: dep_libexec_weston, |
| 50 | install_rpath: dir_module_weston, |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 51 | install: true |
| 52 | ) |
| 53 | install_headers('weston.h', subdir: 'weston') |
| 54 | |
| 55 | pkgconfig.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 | |
| 68 | install_data( |
| 69 | 'weston.desktop', |
| 70 | install_dir: join_paths(dir_data, 'wayland-sessions') |
| 71 | ) |
| 72 | |
| 73 | if 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 Paalanen | 8e7f950 | 2019-07-09 12:00:41 +0300 | [diff] [blame] | 80 | dep_libexec_weston, |
Stefan Agner | 483c6d4 | 2019-03-20 00:09:51 +0100 | [diff] [blame] | 81 | dep_libshared, |
Pekka Paalanen | 71ff95a | 2019-04-18 16:43:55 +0300 | [diff] [blame] | 82 | dep_libweston_public, |
| 83 | dep_libweston_private_h, # XXX: https://gitlab.freedesktop.org/wayland/weston/issues/292 |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 84 | dep_wayland_client, |
| 85 | ] |
| 86 | plugin_screenshare = shared_library( |
| 87 | 'screen-share', |
| 88 | srcs_screenshare, |
Pekka Paalanen | 4f5e360 | 2019-04-05 17:09:28 +0300 | [diff] [blame] | 89 | include_directories: common_inc, |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 90 | dependencies: deps_screenshare, |
| 91 | name_prefix: '', |
| 92 | install: true, |
Philipp Zabel | 4b1de01 | 2020-02-05 00:40:01 +0100 | [diff] [blame] | 93 | install_dir: dir_module_weston, |
| 94 | install_rpath: '$ORIGIN' |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 95 | ) |
| 96 | env_modmap += 'screen-share.so=@0@;'.format(plugin_screenshare.full_path()) |
| 97 | endif |
| 98 | |
| 99 | if 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 Paalanen | 37dabe5 | 2018-12-31 14:17:23 +0200 | [diff] [blame] | 106 | |
| 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 Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 112 | plugin_lcms = shared_library( |
| 113 | 'cms-static', |
| 114 | srcs_lcms, |
Pekka Paalanen | 4f5e360 | 2019-04-05 17:09:28 +0300 | [diff] [blame] | 115 | include_directories: common_inc, |
Pekka Paalanen | 8e7f950 | 2019-07-09 12:00:41 +0300 | [diff] [blame] | 116 | dependencies: [ dep_libexec_weston, dep_libweston_public, dep_lcms2 ], |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 117 | name_prefix: '', |
| 118 | install: true, |
Philipp Zabel | 4b1de01 | 2020-02-05 00:40:01 +0100 | [diff] [blame] | 119 | install_dir: dir_module_weston, |
| 120 | install_rpath: '$ORIGIN' |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 121 | ) |
| 122 | env_modmap += 'cms-static.so=@0@;'.format(plugin_lcms.full_path()) |
| 123 | endif |
| 124 | |
| 125 | if get_option('color-management-colord') |
| 126 | if not get_option('color-management-lcms') |
Emmanuel Gil Peyrot | 5b5decb | 2021-02-11 23:44:20 +0100 | [diff] [blame] | 127 | error('LCMS must be enabled to support colord. Or, you can use \'-Dcolor-management-colord=false\'.') |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 128 | endif |
| 129 | |
| 130 | srcs_colord = [ |
| 131 | 'cms-colord.c', |
| 132 | 'cms-helper.c', |
| 133 | ] |
Pekka Paalanen | 217a15c | 2018-12-31 14:20:40 +0200 | [diff] [blame] | 134 | |
| 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 Champagne | 7451f99 | 2020-06-01 21:59:12 -0400 | [diff] [blame] | 140 | plugin_colord_deps = [ dep_libweston_public, dep_colord, dep_lcms2 ] |
Pekka Paalanen | 191c453 | 2019-03-22 14:20:51 +0200 | [diff] [blame] | 141 | |
| 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 Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 150 | plugin_colord = shared_library( |
| 151 | 'cms-colord', |
| 152 | srcs_colord, |
Pekka Paalanen | 4f5e360 | 2019-04-05 17:09:28 +0300 | [diff] [blame] | 153 | include_directories: common_inc, |
Pekka Paalanen | 191c453 | 2019-03-22 14:20:51 +0200 | [diff] [blame] | 154 | dependencies: plugin_colord_deps, |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 155 | name_prefix: '', |
| 156 | install: true, |
| 157 | install_dir: dir_module_weston |
| 158 | ) |
| 159 | env_modmap += 'cms-colord.so=@0@;'.format(plugin_colord.full_path()) |
| 160 | endif |
| 161 | |
| 162 | if get_option('systemd') |
Pekka Paalanen | d64649b | 2018-12-31 14:23:59 +0200 | [diff] [blame] | 163 | 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 Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 168 | plugin_systemd_notify = shared_library( |
| 169 | 'systemd-notify', |
| 170 | 'systemd-notify.c', |
Pekka Paalanen | 4f5e360 | 2019-04-05 17:09:28 +0300 | [diff] [blame] | 171 | include_directories: common_inc, |
Pekka Paalanen | 71ff95a | 2019-04-18 16:43:55 +0300 | [diff] [blame] | 172 | dependencies: [ dep_libweston_public, dep_libsystemd ], |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 173 | 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()) |
| 178 | endif |
| 179 | |
leng.fang | 32af9fc | 2024-06-13 11:22:15 +0800 | [diff] [blame] | 180 | config_h.set('AML_MAX_OUTPUT_PIPLINE', get_option('WESTON_MAX_OUTPUT_PIPLINE')) |
| 181 | config_h.set('HAVE_GBM_MODIFIERS', get_option('WESTON_HAVE_GBM_MODIFIERS')) |
| 182 | |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 183 | weston_ini_config = configuration_data() |
| 184 | weston_ini_config.set('bindir', dir_bin) |
| 185 | weston_ini_config.set('libexecdir', dir_libexec) |
Daniel Stone | 8011b0f | 2016-11-24 15:54:51 +0000 | [diff] [blame] | 186 | configure_file( |
| 187 | input: '../weston.ini.in', |
| 188 | output: 'weston.ini', |
| 189 | configuration: weston_ini_config |
| 190 | ) |