1 cpp = meson.get_compiler('cpp')
2 dep_wayland_client = dependency('wayland-client', version: '>= 1.20.0')
4 dep_wp = dependency('wayland-protocols', version: '>= 1.24')
5 dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir')
7 grpcpp_reflection_dep = cpp.find_library('grpc++_reflection')
8 protoc = find_program('protoc')
9 grpc_cpp = find_program('grpc_cpp_plugin')
11 dep_scanner = dependency('wayland-scanner')
12 prog_scanner = find_program('wayland-scanner')
14 protoc_gen = generator(protoc, \
15 output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
16 arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/protocol',
17 '--cpp_out=@BUILD_DIR@',
20 generated_protoc_sources = protoc_gen.process('protocol/agl_shell.proto')
22 grpc_gen = generator(protoc, \
23 output : ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'],
24 arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/protocol',
25 '--grpc_out=@BUILD_DIR@',
26 '--plugin=protoc-gen-grpc=' + grpc_cpp.path(),
29 generated_grpc_sources = grpc_gen.process('protocol/agl_shell.proto')
32 dependency('protobuf'),
35 grpcpp_reflection_dep,
40 [ 'xdg-shell', 'stable' ],
43 foreach proto: protocols
45 if proto[1] == 'internal'
46 base_file = proto_name
47 xml_path = '@0@.xml'.format(proto_name)
48 elif proto[1] == 'stable'
49 base_file = proto_name
50 xml_path = '@0@/stable/@1@/@1@.xml'.format(dir_wp_base, base_file)
52 base_file = '@0@-unstable-@1@'.format(proto_name, proto[1])
53 xml_path = '@0@/unstable/@1@/@2@.xml'.format(dir_wp_base, proto_name, base_file)
56 foreach output_type: [ 'client-header', 'server-header', 'private-code' ]
57 if output_type == 'client-header'
58 output_file = '@0@-client-protocol.h'.format(base_file)
59 elif output_type == 'server-header'
60 output_file = '@0@-server-protocol.h'.format(base_file)
62 output_file = '@0@-protocol.c'.format(base_file)
63 if dep_scanner.version().version_compare('< 1.14.91')
68 var_name = output_file.underscorify()
69 target = custom_target(
70 '@0@ @1@'.format(base_file, output_type),
71 command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ],
76 set_variable(var_name, target)
80 depnames_gstreamer = [
81 'gstreamer-1.0', 'gstreamer-plugins-bad-1.0', 'gstreamer-wayland-1.0',
82 'gstreamer-video-1.0', 'gstreamer-plugins-base-1.0',
86 foreach depname : depnames_gstreamer
87 dep = dependency(depname, required: false)
89 error('Required @0@ which was not found. '.format(depname) + user_hint)
95 camera_gstreamer_dep = [
101 camera_gstreamer_src_headers = [
102 xdg_shell_client_protocol_h,
104 'AglShellGrpcClient.h',
107 camera_gstreamer_src = [
108 xdg_shell_protocol_c,
110 'AglShellGrpcClient.cpp',
112 generated_protoc_sources,
113 generated_grpc_sources
116 install_data('still-image.jpg', install_dir: get_option('datadir') / 'applications/data')
118 executable('camera-gstreamer', camera_gstreamer_src, camera_gstreamer_src_headers,
119 dependencies : camera_gstreamer_dep,