1 project('agl-compositor',
8 meson_version: '>= 0.47',
12 cc = meson.get_compiler('c')
13 add_project_arguments(
14 cc.get_supported_arguments([
15 '-Wno-unused-parameter',
21 add_project_arguments([
22 '-DPACKAGE_STRING="agl-compositor @0@"'.format(meson.project_version()),
29 optional_libc_funcs = [ 'memfd_create', 'strchrnul' ]
30 foreach func: optional_libc_funcs
31 if cc.has_function(func)
32 add_project_arguments('-DHAVE_@0@=1'.format(func.to_upper()), language: 'c')
36 dep_scanner = dependency('wayland-scanner', native: true)
37 prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
38 dep_wp = dependency('wayland-protocols', version: '>= 1.12')
39 dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir')
41 agl_shell_xml = files('protocol/agl-shell.xml')
42 xdg_shell_xml = join_paths(dir_wp_base, 'stable', 'xdg-shell', 'xdg-shell.xml')
45 { 'name': 'agl-shell', 'source': 'internal' },
46 { 'name': 'xdg-shell', 'source': 'wp-stable' },
49 foreach proto: protocols
50 proto_name = proto['name']
51 if proto['source'] == 'internal'
52 base_file = proto_name
53 xml_path = join_paths('protocol', '@0@.xml'.format(base_file))
54 elif proto['source'] == 'wp-stable'
55 base_file = proto_name
56 xml_path = join_paths(dir_wp_base, 'stable', proto_name, '@0@.xml'.format(base_file))
58 base_file = '@0@-unstable-@1@'.format(proto_name, proto['version'])
59 xml_path = join_paths(dir_wp_base, 'unstable', proto_name, '@0@.xml'.format(base_file))
62 foreach output_type: [ 'client-header', 'server-header', 'private-code' ]
63 if output_type == 'client-header'
64 output_file = '@0@-client-protocol.h'.format(base_file)
65 elif output_type == 'server-header'
66 output_file = '@0@-server-protocol.h'.format(base_file)
68 output_file = '@0@-protocol.c'.format(base_file)
69 if dep_scanner.version().version_compare('< 1.14.91')
74 var_name = output_file.underscorify()
75 target = custom_target(
76 '@0@ @1@'.format(base_file, output_type),
77 command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ],
82 set_variable(var_name, target)
87 dependency('wayland-server'),
88 dependency('libweston-6'),
89 dependency('libweston-desktop-6'),
92 srcs_agl_compositor = [
96 'shared/option-parser.c',
97 'shared/os-compatibility.c',
98 agl_shell_server_protocol_h,
100 xdg_shell_protocol_c,
103 exe_agl_compositor = executable(
106 dependencies: deps_libweston,