| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | project(
 | 
					
						
							|  |  |  |   'labwc',
 | 
					
						
							|  |  |  |   'c',
 | 
					
						
							| 
									
										
										
										
											2025-07-11 21:50:42 +01:00
										 |  |  |   version: '0.9.0',
 | 
					
						
							| 
									
										
										
										
											2021-09-01 12:03:12 +02:00
										 |  |  |   license: 'GPL-2.0-only',
 | 
					
						
							| 
									
										
										
										
											2021-09-22 20:21:00 +01:00
										 |  |  |   meson_version: '>=0.59.0',
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  |   default_options: [
 | 
					
						
							|  |  |  |     'c_std=c11',
 | 
					
						
							|  |  |  |     'warning_level=2',
 | 
					
						
							|  |  |  |   ],
 | 
					
						
							|  |  |  | )
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | add_project_arguments(
 | 
					
						
							|  |  |  |   [
 | 
					
						
							|  |  |  |     '-DWLR_USE_UNSTABLE',
 | 
					
						
							|  |  |  |   ],
 | 
					
						
							|  |  |  |   language: 'c',
 | 
					
						
							|  |  |  | )
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cc = meson.get_compiler('c')
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-01-31 03:35:13 +01:00
										 |  |  | add_project_arguments(cc.get_supported_arguments([
 | 
					
						
							|  |  |  |   '-Wundef',
 | 
					
						
							|  |  |  |   '-Wlogical-op',
 | 
					
						
							|  |  |  |   '-Wmissing-include-dirs',
 | 
					
						
							|  |  |  |   '-Wold-style-definition',
 | 
					
						
							|  |  |  |   '-Wpointer-arith',
 | 
					
						
							|  |  |  |   '-Winit-self',
 | 
					
						
							|  |  |  |   '-Wstrict-prototypes',
 | 
					
						
							|  |  |  |   '-Wimplicit-fallthrough=2',
 | 
					
						
							|  |  |  |   '-Wendif-labels',
 | 
					
						
							|  |  |  |   '-Wstrict-aliasing=2',
 | 
					
						
							|  |  |  |   '-Woverflow',
 | 
					
						
							|  |  |  |   '-Wmissing-prototypes',
 | 
					
						
							|  |  |  |   '-Walloca',
 | 
					
						
							|  |  |  |   '-Wunused-macros',
 | 
					
						
							| 
									
										
										
										
											2025-05-23 13:09:15 +09:00
										 |  |  |   '-Wshadow',
 | 
					
						
							| 
									
										
										
										
											2023-01-31 03:35:13 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   '-Wno-unused-parameter',
 | 
					
						
							| 
									
										
										
										
											2024-09-23 22:14:22 +01:00
										 |  |  |   '-Wno-expansion-to-defined',
 | 
					
						
							| 
									
										
										
										
											2023-01-31 03:35:13 +01:00
										 |  |  | ]), language: 'c')
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-06 11:38:17 +00:00
										 |  |  | version='"@0@"'.format(meson.project_version())
 | 
					
						
							| 
									
										
										
										
											2021-03-17 21:21:49 +00:00
										 |  |  | git = find_program('git', native: true, required: false)
 | 
					
						
							|  |  |  | if git.found()
 | 
					
						
							| 
									
										
										
										
											2022-02-14 20:22:23 +00:00
										 |  |  |   git_commit = run_command([git, 'describe', '--dirty'], check: false)
 | 
					
						
							| 
									
										
										
										
											2021-03-17 21:21:49 +00:00
										 |  |  |   if git_commit.returncode() == 0
 | 
					
						
							|  |  |  |     version = '"@0@"'.format(git_commit.stdout().strip())
 | 
					
						
							|  |  |  |   endif
 | 
					
						
							|  |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2021-03-06 11:38:17 +00:00
										 |  |  | add_project_arguments('-DLABWC_VERSION=@0@'.format(version), language: 'c')
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-09 17:44:47 -04:00
										 |  |  | wlroots = dependency(
 | 
					
						
							| 
									
										
										
										
											2025-02-02 14:22:24 -05:00
										 |  |  |   'wlroots-0.19',
 | 
					
						
							| 
									
										
										
										
											2021-11-08 20:17:50 +02:00
										 |  |  |   default_options: ['default_library=static', 'examples=false'],
 | 
					
						
							| 
									
										
										
										
											2025-02-02 14:22:24 -05:00
										 |  |  |   version: ['>=0.19.0', '<0.20.0'],
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | )
 | 
					
						
							| 
									
										
										
										
											2020-05-27 14:29:05 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-09 17:44:47 -04:00
										 |  |  | wlroots_has_xwayland = wlroots.get_variable('have_xwayland') == 'true'
 | 
					
						
							| 
									
										
										
										
											2024-10-01 18:47:15 +09:00
										 |  |  | have_libsfdo = not get_option('icon').disabled()
 | 
					
						
							| 
									
										
										
										
											2022-05-09 17:44:47 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-26 18:23:46 +01:00
										 |  |  | wayland_server = dependency('wayland-server', version: '>=1.19.0')
 | 
					
						
							| 
									
										
										
										
											2025-05-23 13:26:23 +02:00
										 |  |  | wayland_protos = dependency('wayland-protocols', version: '>=1.39')
 | 
					
						
							| 
									
										
										
										
											2021-06-26 18:23:46 +01:00
										 |  |  | xkbcommon = dependency('xkbcommon')
 | 
					
						
							|  |  |  | xcb = dependency('xcb', required: get_option('xwayland'))
 | 
					
						
							| 
									
										
										
										
											2025-05-29 19:17:24 +02:00
										 |  |  | xcb_ewmh = dependency('xcb-ewmh', required: get_option('xwayland'))
 | 
					
						
							| 
									
										
										
										
											2022-04-20 18:48:49 +01:00
										 |  |  | xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland'))
 | 
					
						
							| 
									
										
										
										
											2021-06-26 18:23:46 +01:00
										 |  |  | drm_full = dependency('libdrm')
 | 
					
						
							|  |  |  | drm = drm_full.partial_dependency(compile_args: true, includes: true)
 | 
					
						
							|  |  |  | xml2 = dependency('libxml-2.0')
 | 
					
						
							|  |  |  | glib = dependency('glib-2.0')
 | 
					
						
							|  |  |  | cairo = dependency('cairo')
 | 
					
						
							|  |  |  | pangocairo = dependency('pangocairo')
 | 
					
						
							|  |  |  | input = dependency('libinput', version: '>=1.14')
 | 
					
						
							| 
									
										
										
										
											2023-01-30 05:30:24 +01:00
										 |  |  | pixman = dependency('pixman-1')
 | 
					
						
							| 
									
										
										
										
											2021-06-26 18:23:46 +01:00
										 |  |  | math = cc.find_library('m')
 | 
					
						
							| 
									
										
										
										
											2023-08-04 22:34:07 +01:00
										 |  |  | png = dependency('libpng')
 | 
					
						
							| 
									
										
										
										
											2023-08-21 21:26:08 +01:00
										 |  |  | svg = dependency('librsvg-2.0', version: '>=2.46', required: false)
 | 
					
						
							| 
									
										
										
										
											2024-09-06 17:00:40 +09:00
										 |  |  | sfdo_basedir = dependency(
 | 
					
						
							|  |  |  |   'libsfdo-basedir',
 | 
					
						
							|  |  |  |   default_options: ['default_library=static', 'examples=false', 'tests=false'],
 | 
					
						
							| 
									
										
										
										
											2024-10-24 21:59:21 +01:00
										 |  |  |   version: '>=0.1.3',
 | 
					
						
							| 
									
										
										
										
											2024-10-01 18:47:15 +09:00
										 |  |  |   required: have_libsfdo,
 | 
					
						
							| 
									
										
										
										
											2024-09-06 17:00:40 +09:00
										 |  |  | )
 | 
					
						
							|  |  |  | sfdo_desktop = dependency(
 | 
					
						
							|  |  |  |   'libsfdo-desktop',
 | 
					
						
							|  |  |  |   default_options: ['default_library=static', 'examples=false', 'tests=false'],
 | 
					
						
							| 
									
										
										
										
											2024-10-24 21:59:21 +01:00
										 |  |  |   version: '>=0.1.3',
 | 
					
						
							| 
									
										
										
										
											2024-10-01 18:47:15 +09:00
										 |  |  |   required: have_libsfdo,
 | 
					
						
							| 
									
										
										
										
											2024-09-06 17:00:40 +09:00
										 |  |  | )
 | 
					
						
							|  |  |  | sfdo_icon = dependency(
 | 
					
						
							|  |  |  |   'libsfdo-icon',
 | 
					
						
							|  |  |  |   default_options: ['default_library=static', 'examples=false', 'tests=false'],
 | 
					
						
							| 
									
										
										
										
											2024-10-24 21:59:21 +01:00
										 |  |  |   version: '>=0.1.3',
 | 
					
						
							| 
									
										
										
										
											2024-10-01 18:47:15 +09:00
										 |  |  |   required: have_libsfdo,
 | 
					
						
							| 
									
										
										
										
											2024-09-06 17:00:40 +09:00
										 |  |  | )
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-28 17:34:53 +02:00
										 |  |  | xwayland = dependency(
 | 
					
						
							|  |  |  |   'xwayland',
 | 
					
						
							|  |  |  |   version: '>=21.1.9',
 | 
					
						
							|  |  |  |   required: get_option('xwayland'),
 | 
					
						
							|  |  |  | )
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-30 10:29:21 +00:00
										 |  |  | if get_option('xwayland').enabled() and not wlroots_has_xwayland
 | 
					
						
							|  |  |  | 	error('no wlroots Xwayland support')
 | 
					
						
							|  |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2025-06-28 17:34:53 +02:00
										 |  |  | if get_option('xwayland').disabled()
 | 
					
						
							|  |  |  | 	have_xwayland = false
 | 
					
						
							|  |  |  | elif not xwayland.found()
 | 
					
						
							|  |  |  | 	warning('disabling xwayland, requires version >= 21.1.9')
 | 
					
						
							|  |  |  | 	have_xwayland = false
 | 
					
						
							|  |  |  | elif xcb.found() and wlroots_has_xwayland
 | 
					
						
							|  |  |  | 	have_xwayland = true
 | 
					
						
							|  |  |  | else
 | 
					
						
							|  |  |  | 	have_xwayland = false
 | 
					
						
							|  |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2020-12-30 10:29:21 +00:00
										 |  |  | conf_data = configuration_data()
 | 
					
						
							|  |  |  | conf_data.set10('HAVE_XWAYLAND', have_xwayland)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-17 11:40:48 +01:00
										 |  |  | if get_option('svg').disabled()
 | 
					
						
							|  |  |  |   have_rsvg = false
 | 
					
						
							|  |  |  | else
 | 
					
						
							|  |  |  |   have_rsvg = svg.found()
 | 
					
						
							|  |  |  | endif
 | 
					
						
							|  |  |  | conf_data.set10('HAVE_RSVG', have_rsvg)
 | 
					
						
							| 
									
										
										
										
											2023-08-21 21:26:08 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-06 17:00:40 +09:00
										 |  |  | conf_data.set10('HAVE_LIBSFDO', have_libsfdo)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-06 23:08:53 +02:00
										 |  |  | foreach sym : ['LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY', 'LIBINPUT_CONFIG_3FG_DRAG_ENABLED_3FG']
 | 
					
						
							| 
									
										
										
										
											2025-06-07 19:27:05 +09:00
										 |  |  | 	conf_data.set10('HAVE_' + sym, cc.has_header_symbol('libinput.h', sym, dependencies: input))
 | 
					
						
							|  |  |  | endforeach
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-08 17:32:16 +02:00
										 |  |  | if get_option('static_analyzer').enabled()
 | 
					
						
							|  |  |  |   add_project_arguments(['-fanalyzer'], language: 'c')
 | 
					
						
							|  |  |  | endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-01 14:38:45 +10:00
										 |  |  | msgfmt = find_program('msgfmt', required: get_option('nls'))
 | 
					
						
							|  |  |  | if msgfmt.found()
 | 
					
						
							|  |  |  |   source_root = meson.current_source_dir()
 | 
					
						
							|  |  |  |   conf_data.set('HAVE_NLS', 1)
 | 
					
						
							|  |  |  |   subdir('po')
 | 
					
						
							|  |  |  | else
 | 
					
						
							|  |  |  |   conf_data.set('HAVE_NLS', 0)
 | 
					
						
							|  |  |  | endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-26 18:23:46 +01:00
										 |  |  | labwc_inc = include_directories('include')
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | subdir('protocols')
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-26 18:23:46 +01:00
										 |  |  | labwc_deps = [
 | 
					
						
							| 
									
										
										
										
											2021-03-13 23:33:32 +00:00
										 |  |  |   server_protos,
 | 
					
						
							|  |  |  |   wayland_server,
 | 
					
						
							|  |  |  |   wlroots,
 | 
					
						
							|  |  |  |   xkbcommon,
 | 
					
						
							| 
									
										
										
										
											2025-05-29 19:17:24 +02:00
										 |  |  | 	xcb_ewmh,
 | 
					
						
							| 
									
										
										
										
											2022-04-20 18:48:49 +01:00
										 |  |  |   xcb_icccm,
 | 
					
						
							| 
									
										
										
										
											2021-03-13 23:33:32 +00:00
										 |  |  |   xml2,
 | 
					
						
							|  |  |  |   glib,
 | 
					
						
							|  |  |  |   cairo,
 | 
					
						
							|  |  |  |   drm,
 | 
					
						
							|  |  |  |   pangocairo,
 | 
					
						
							|  |  |  |   input,
 | 
					
						
							| 
									
										
										
										
											2023-01-30 05:30:24 +01:00
										 |  |  |   pixman,
 | 
					
						
							| 
									
										
										
										
											2021-03-13 23:33:32 +00:00
										 |  |  |   math,
 | 
					
						
							| 
									
										
										
										
											2023-08-04 22:34:07 +01:00
										 |  |  |   png,
 | 
					
						
							| 
									
										
										
										
											2020-06-05 23:04:54 +01:00
										 |  |  | ]
 | 
					
						
							| 
									
										
										
										
											2023-09-17 11:40:48 +01:00
										 |  |  | if have_rsvg
 | 
					
						
							| 
									
										
										
										
											2023-08-21 21:26:08 +01:00
										 |  |  |   labwc_deps += [
 | 
					
						
							|  |  |  |     svg,
 | 
					
						
							|  |  |  |   ]
 | 
					
						
							|  |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2024-09-06 17:00:40 +09:00
										 |  |  | if have_libsfdo
 | 
					
						
							|  |  |  |   labwc_deps += [
 | 
					
						
							|  |  |  |     sfdo_basedir,
 | 
					
						
							|  |  |  |     sfdo_desktop,
 | 
					
						
							|  |  |  |     sfdo_icon,
 | 
					
						
							|  |  |  |   ]
 | 
					
						
							|  |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-30 10:29:21 +00:00
										 |  |  | subdir('include')
 | 
					
						
							| 
									
										
										
										
											2020-08-05 20:14:17 +01:00
										 |  |  | subdir('src')
 | 
					
						
							|  |  |  | subdir('docs')
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-23 15:07:25 +01:00
										 |  |  | dep_cmocka = dependency('cmocka', required: get_option('test'))
 | 
					
						
							|  |  |  | if dep_cmocka.found()
 | 
					
						
							|  |  |  |   subdir('t')
 | 
					
						
							|  |  |  | endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | executable(
 | 
					
						
							|  |  |  |   meson.project_name(),
 | 
					
						
							| 
									
										
										
										
											2020-05-27 14:29:05 +01:00
										 |  |  |   labwc_sources,
 | 
					
						
							|  |  |  |   include_directories: [labwc_inc],
 | 
					
						
							|  |  |  |   dependencies: labwc_deps,
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  |   install: true,
 | 
					
						
							|  |  |  | )
 | 
					
						
							| 
									
										
										
										
											2021-07-12 21:41:12 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-22 14:44:58 -05:00
										 |  |  | install_data('data/labwc.desktop', install_dir: get_option('datadir') / 'wayland-sessions')
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-01 16:33:45 -04:00
										 |  |  | install_data('data/labwc-portals.conf', install_dir: get_option('datadir') / 'xdg-desktop-portal')
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-30 19:59:46 +01:00
										 |  |  | # TODO: move this to clients/meson.build after the labnag PR
 | 
					
						
							|  |  |  | clients = files('clients/lab-sensible-terminal')
 | 
					
						
							|  |  |  | install_data(clients, install_dir: get_option('bindir'))
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-22 14:44:58 -05:00
										 |  |  | icons = ['labwc-symbolic.svg', 'labwc.svg']
 | 
					
						
							|  |  |  | foreach icon : icons
 | 
					
						
							|  |  |  |   icon_path = join_paths('data', icon)
 | 
					
						
							|  |  |  |   install_data(icon_path, install_dir: get_option('datadir') / 'icons/hicolor/scalable/apps')
 | 
					
						
							|  |  |  | endforeach
 |