| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | project(
 | 
					
						
							|  |  |  |   'labwc',
 | 
					
						
							|  |  |  |   'c',
 | 
					
						
							| 
									
										
										
										
											2021-12-31 21:05:49 +00:00
										 |  |  |   version: '0.4.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')
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-27 14:29:05 +01:00
										 |  |  | add_project_arguments(cc.get_supported_arguments(
 | 
					
						
							|  |  |  |   [
 | 
					
						
							|  |  |  |     '-Wno-unused-parameter',
 | 
					
						
							|  |  |  |     '-Wundef',
 | 
					
						
							|  |  |  |   ]),
 | 
					
						
							|  |  |  |   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()
 | 
					
						
							|  |  |  |   git_commit = run_command([git, 'describe', '--dirty'])
 | 
					
						
							|  |  |  |   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-02-04 21:17:05 +01:00
										 |  |  | wlroots_version = ['>=0.15.0', '<0.16.0']
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | wlroots_proj = subproject(
 | 
					
						
							| 
									
										
										
										
											2020-05-27 14:29:05 +01:00
										 |  |  |   'wlroots',
 | 
					
						
							| 
									
										
										
										
											2021-11-08 20:17:50 +02:00
										 |  |  |   default_options: ['default_library=static', 'examples=false'],
 | 
					
						
							| 
									
										
										
										
											2020-05-27 14:29:05 +01:00
										 |  |  |   required: false,
 | 
					
						
							| 
									
										
										
										
											2021-04-17 14:26:25 +01:00
										 |  |  |   version: wlroots_version,
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | )
 | 
					
						
							| 
									
										
										
										
											2020-05-27 14:29:05 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | if wlroots_proj.found()
 | 
					
						
							| 
									
										
										
										
											2021-06-26 18:23:46 +01:00
										 |  |  |   wlroots = wlroots_proj.get_variable('wlroots')
 | 
					
						
							| 
									
										
										
										
											2020-12-30 10:29:21 +00:00
										 |  |  |   wlroots_conf = wlroots_proj.get_variable('conf_data')
 | 
					
						
							|  |  |  |   wlroots_has_xwayland = wlroots_conf.get('WLR_HAS_XWAYLAND') == 1
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | else
 | 
					
						
							| 
									
										
										
										
											2021-06-26 18:23:46 +01:00
										 |  |  |   wlroots = dependency('wlroots', version: wlroots_version)
 | 
					
						
							| 
									
										
										
										
											2020-12-30 10:29:21 +00:00
										 |  |  |   wlroots_has_xwayland = cc.get_define('WLR_HAS_XWAYLAND', prefix: '#include <wlr/config.h>', dependencies: wlroots) == '1'
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | endif
 | 
					
						
							| 
									
										
										
										
											2021-06-26 18:23:46 +01:00
										 |  |  | wayland_server = dependency('wayland-server', version: '>=1.19.0')
 | 
					
						
							|  |  |  | wayland_protos = dependency('wayland-protocols')
 | 
					
						
							|  |  |  | xkbcommon = dependency('xkbcommon')
 | 
					
						
							|  |  |  | xcb = dependency('xcb', required: get_option('xwayland'))
 | 
					
						
							|  |  |  | 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')
 | 
					
						
							|  |  |  | pixman = dependency('pixman-1')
 | 
					
						
							|  |  |  | math = cc.find_library('m')
 | 
					
						
							| 
									
										
										
										
											2020-05-20 22:04:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-30 10:29:21 +00:00
										 |  |  | if get_option('xwayland').enabled() and not wlroots_has_xwayland
 | 
					
						
							|  |  |  | 	error('no wlroots Xwayland support')
 | 
					
						
							|  |  |  | endif
 | 
					
						
							|  |  |  | have_xwayland = xcb.found() and wlroots_has_xwayland
 | 
					
						
							|  |  |  | conf_data = configuration_data()
 | 
					
						
							|  |  |  | conf_data.set10('HAVE_XWAYLAND', have_xwayland)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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,
 | 
					
						
							|  |  |  |   xml2,
 | 
					
						
							|  |  |  |   glib,
 | 
					
						
							|  |  |  |   cairo,
 | 
					
						
							|  |  |  |   drm,
 | 
					
						
							|  |  |  |   pangocairo,
 | 
					
						
							|  |  |  |   input,
 | 
					
						
							|  |  |  |   pixman,
 | 
					
						
							|  |  |  |   math,
 | 
					
						
							| 
									
										
										
										
											2020-06-05 23:04:54 +01:00
										 |  |  | ]
 | 
					
						
							| 
									
										
										
										
											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')
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							|  |  |  | install_data('docs/labwc.desktop', install_dir: get_option('datadir') / 'wayland-sessions')
 |