1 cpp = meson.get_compiler('cpp')
2 qt5_dep = dependency('qt5', modules: ['Qml', 'Quick', 'Gui'])
3 dep_wayland_client = dependency('wayland-client', version: '>= 1.20.0')
5 dependency('qtappfw-weather'),
6 dependency('qtappfw-network'),
7 dependency('qtappfw-bt'),
8 dependency('qtappfw-vehicle-signals'),
9 dependency('qtappfw-applauncher')
12 grpcpp_reflection_dep = cpp.find_library('grpc++_reflection')
13 protoc = find_program('protoc')
14 grpc_cpp = find_program('grpc_cpp_plugin')
17 qpa_header_path = join_paths(qt5_dep.version(), 'QtGui')
18 qpa_header = join_paths(qpa_header_path, 'qpa/qplatformnativeinterface.h')
19 # we pass this QT_QPA_HEADER straight in the code as there's no easy
20 # way to pass the correct header
21 if cpp.has_header(qpa_header, dependencies : qt5_dep)
22 qt_defines += [ '-DQT_QPA_HEADER=<@0@>'.format(qpa_header) ]
23 message('Found QtGui QPA header in ' + qpa_header_path)
26 dep_scanner = dependency('wayland-scanner')
27 prog_scanner = find_program('wayland-scanner')
28 agl_compositor_version = '0.0.24'
29 agl_compositor_dep = dependency('agl-compositor-' + agl_compositor_version + '-protocols')
30 dir_agl_compositor_base = agl_compositor_dep.get_variable(pkgconfig: 'pkgdatadir')
32 protoc_gen = generator(protoc, \
33 output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
34 arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/proto',
35 '--cpp_out=@BUILD_DIR@',
38 generated_protoc_sources = protoc_gen.process('proto/agl_shell.proto')
40 grpc_gen = generator(protoc, \
41 output : ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'],
42 arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/proto',
43 '--grpc_out=@BUILD_DIR@',
44 '--plugin=protoc-gen-grpc=' + grpc_cpp.path(),
46 generated_grpc_sources = grpc_gen.process('proto/agl_shell.proto')
49 dependency('protobuf'),
52 grpcpp_reflection_dep,
63 homescreen_resources = [
64 'qml/images/MediaPlayer/mediaplayer.qrc',
65 'qml/images/MediaMusic/mediamusic.qrc',
66 'qml/images/Weather/weather.qrc',
67 'qml/images/Shortcut/shortcut.qrc',
68 'qml/images/Status/status.qrc',
69 'qml/images/images.qrc',
73 resource_files = qt5.compile_resources(sources: homescreen_resources)
76 [ 'agl-shell', 'agl-compositor' ],
79 foreach proto: protocols
81 if proto[1] == 'agl-compositor'
82 base_file = proto_name
83 xml_path = join_paths(dir_agl_compositor_base, '@0@.xml'.format(base_file))
86 foreach output_type: [ 'client-header', 'server-header', 'private-code' ]
87 if output_type == 'client-header'
88 output_file = '@0@-client-protocol.h'.format(base_file)
89 elif output_type == 'server-header'
90 output_file = '@0@-server-protocol.h'.format(base_file)
92 output_file = '@0@-protocol.c'.format(base_file)
93 if dep_scanner.version().version_compare('< 1.14.91')
98 var_name = output_file.underscorify()
99 target = custom_target(
100 '@0@ @1@'.format(base_file, output_type),
101 command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ],
105 message('protocol name is ' + var_name)
106 set_variable(var_name, target)
110 homescreen_src_headers = [
111 'src/applicationlauncher.h',
112 'src/mastervolume.h',
113 'src/statusbarmodel.h',
114 'src/statusbarserver.h',
115 'src/homescreenhandler.h',
116 'src/AglShellGrpcClient.h',
119 moc_files = qt5.compile_moc(headers: homescreen_src_headers,
120 dependencies: qt5_dep)
123 'src/statusbarserver.cpp',
124 'src/statusbarmodel.cpp',
125 'src/applicationlauncher.cpp',
126 'src/mastervolume.cpp',
127 'src/homescreenhandler.cpp',
128 'src/AglShellGrpcClient.cpp',
130 agl_shell_client_protocol_h,
131 agl_shell_protocol_c,
132 generated_protoc_sources,
133 generated_grpc_sources
136 executable('homescreen', homescreen_src, resource_files, moc_files,
137 cpp_args: qt_defines,
138 dependencies : homescreen_dep,