diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2023-11-30 15:51:56 +0200 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2023-12-04 23:47:03 +0200 |
commit | f00c1e19f5c4cbcd185c8043f3062612bf1537f7 (patch) | |
tree | 453b6571c97cc90dbc98d8a8e3d654f7e9208ad2 /app/meson.build | |
parent | 7fd8b36ce15d7617229a86a05e4e431631e684d5 (diff) |
tbtnavi: Add gRPC API support
This adds support for gRPC API specifically specifically to allow
placing the application on a different output, the remoting one.
Bug-AGL: SPEC-5003
Change-Id: Ibe7047b3b21dc67c44111a8b615a51588d2216d9
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Diffstat (limited to 'app/meson.build')
-rw-r--r-- | app/meson.build | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/app/meson.build b/app/meson.build index 864edb7..a7d1e41 100644 --- a/app/meson.build +++ b/app/meson.build @@ -1,6 +1,33 @@ cpp = meson.get_compiler('cpp') qt5_dep = dependency('qt5', modules: ['Qml', 'Quick', 'Gui', 'Location']) +grpcpp_reflection_dep = cpp.find_library('grpc++_reflection') +protoc = find_program('protoc') +grpc_cpp = find_program('grpc_cpp_plugin') + +protoc_gen = generator(protoc, \ + output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'], + arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/protocol', + '--cpp_out=@BUILD_DIR@', + '@INPUT@']) + +generated_protoc_sources = protoc_gen.process('protocol/agl_shell.proto') + +grpc_gen = generator(protoc, \ + output : ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'], + arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/protocol', + '--grpc_out=@BUILD_DIR@', + '--plugin=protoc-gen-grpc=' + grpc_cpp.path(), + '@INPUT@']) +generated_grpc_sources = grpc_gen.process('protocol/agl_shell.proto') + +grpc_deps = [ + dependency('protobuf'), + dependency('grpc'), + dependency('grpc++'), + grpcpp_reflection_dep, +] + dep_qtappfw = [ dependency('qtappfw-navigation'), dependency('qtappfw-vehicle-signals'), @@ -9,12 +36,14 @@ dep_qtappfw = [ tbtnavi_dep = [ qt5_dep, dep_qtappfw, + grpc_deps ] tbtnavi_headers = [ 'qcheapruler.hpp', 'navigation_client.h', - 'file_operation.h' + 'file_operation.h', + 'AglShellGrpcClient.h' ] moc_files = qt5.compile_moc(headers: tbtnavi_headers, @@ -31,7 +60,10 @@ tbtnavi_src = [ 'main.cpp', 'navigation_client.cpp', 'qcheapruler.cpp', - 'file_operation.cpp' + 'file_operation.cpp', + 'AglShellGrpcClient.cpp', + generated_protoc_sources, + generated_grpc_sources, ] executable('tbtnavi', tbtnavi_src, resource_files, moc_files, |