1 project('agl-compositor',
8 meson_version: '>= 0.47',
12 config_h = configuration_data()
14 cc = meson.get_compiler('c')
15 add_project_arguments(
16 cc.get_supported_arguments([
17 '-Wno-unused-parameter',
23 add_project_arguments([
24 '-DPACKAGE_STRING="agl-compositor @0@"'.format(meson.project_version()),
31 optional_libc_funcs = [ 'memfd_create', 'strchrnul' ]
32 foreach func: optional_libc_funcs
33 if cc.has_function(func)
34 add_project_arguments('-DHAVE_@0@=1'.format(func.to_upper()), language: 'c')
38 dep_libsystemd = dependency('libsystemd', required: false)
39 dep_scanner = dependency('wayland-scanner', native: true)
40 prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
41 dep_wp = dependency('wayland-protocols', version: '>= 1.12')
42 dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir')
44 agl_shell_xml = files('protocol/agl-shell.xml')
45 xdg_shell_xml = join_paths(dir_wp_base, 'stable', 'xdg-shell', 'xdg-shell.xml')
48 { 'name': 'agl-shell', 'source': 'internal' },
49 { 'name': 'xdg-shell', 'source': 'wp-stable' },
52 foreach proto: protocols
53 proto_name = proto['name']
54 if proto['source'] == 'internal'
55 base_file = proto_name
56 xml_path = join_paths('protocol', '@0@.xml'.format(base_file))
57 elif proto['source'] == 'wp-stable'
58 base_file = proto_name
59 xml_path = join_paths(dir_wp_base, 'stable', proto_name, '@0@.xml'.format(base_file))
61 base_file = '@0@-unstable-@1@'.format(proto_name, proto['version'])
62 xml_path = join_paths(dir_wp_base, 'unstable', proto_name, '@0@.xml'.format(base_file))
65 foreach output_type: [ 'client-header', 'server-header', 'private-code' ]
66 if output_type == 'client-header'
67 output_file = '@0@-client-protocol.h'.format(base_file)
68 elif output_type == 'server-header'
69 output_file = '@0@-server-protocol.h'.format(base_file)
71 output_file = '@0@-protocol.c'.format(base_file)
72 if dep_scanner.version().version_compare('< 1.14.91')
77 var_name = output_file.underscorify()
78 target = custom_target(
79 '@0@ @1@'.format(base_file, output_type),
80 command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ],
85 set_variable(var_name, target)
90 dependency('wayland-server'),
91 dependency('libweston-6'),
92 dependency('libweston-desktop-6'),
95 srcs_agl_compositor = [
100 'shared/option-parser.c',
101 'shared/os-compatibility.c',
102 agl_shell_server_protocol_h,
103 agl_shell_protocol_c,
104 xdg_shell_protocol_c,
107 if dep_libsystemd.found()
108 config_h.set('HAVE_SYSTEMD', 1)
110 srcs_agl_compositor += 'src/systemd-notify.c'
111 deps_libweston += dep_libsystemd
113 message('Found systemd, enabling notify support')
116 configure_file(output: 'config.h', configuration: config_h)
118 exe_agl_compositor = executable(
121 dependencies: deps_libweston,