From 82c1c0ab04219f9453f1b3a14a9754068e360583 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 24 Aug 2023 15:43:08 -0400 Subject: Rework to switch to using KUKSA.val databroker Rework to use the "VAL" gRPC API from the KUKSA.val databroker instead of the older server's WebSocket interface. Some source files have been renamed to match the class naming to provide a bit more consistency. Bug-AGL: SPEC-4762 Signed-off-by: Scott Murray Change-Id: I5ded74cfbd6987cd045b7b142fd9f38971aaef66 --- src/meson.build | 59 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 9 deletions(-) (limited to 'src/meson.build') diff --git a/src/meson.build b/src/meson.build index b1603fc..6c50419 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,19 +1,60 @@ boost_dep = dependency('boost', version : '>=1.72', modules : [ 'thread', 'filesystem', 'program_options', 'log', 'system' ]) -openssl_dep = dependency('openssl') -thread_dep = dependency('threads') -wp_dep = dependency('wireplumber-0.4') -src = [ 'vis-config.cpp', - 'vis-session.cpp', - 'audiomixer-service.cpp', - 'audiomixer.c', - 'main.cpp' +cpp = meson.get_compiler('cpp') +grpcpp_reflection_dep = cpp.find_library('grpc++_reflection') + +service_dep = [ + boost_dep, + dependency('openssl'), + dependency('threads'), + dependency('libsystemd'), + dependency('wireplumber-0.4'), + dependency('protobuf'), + dependency('grpc'), + dependency('grpc++'), + grpcpp_reflection_dep ] + +protoc = find_program('protoc') +grpc_cpp = find_program('grpc_cpp_plugin') + +protos_base_dir = get_option('protos') +protos_dir = protos_base_dir / 'kuksa/val/v1' +protoc_gen = generator(protoc, \ + output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'], + arguments : ['-I=' + protos_base_dir, + '--cpp_out=@BUILD_DIR@', + '@INPUT@']) +generated_protoc_sources = [ \ + protoc_gen.process(protos_dir / 'types.proto', preserve_path_from : protos_base_dir), + protoc_gen.process(protos_dir / 'val.proto', preserve_path_from : protos_base_dir), +] + +grpc_gen = generator(protoc, \ + output : ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'], + arguments : ['-I=' + protos_base_dir, + '--grpc_out=@BUILD_DIR@', + '--plugin=protoc-gen-grpc=' + grpc_cpp.path(), + '@INPUT@']) +generated_grpc_sources = [ \ + grpc_gen.process(protos_dir / 'val.proto', preserve_path_from : protos_base_dir), +] + +src = [ + 'KuksaConfig.cpp', + 'KuksaClient.cpp', + 'AudiomixerService.cpp', + 'audiomixer.c', + 'main.cpp', + generated_protoc_sources, + generated_grpc_sources, +] + executable('agl-service-audiomixer', src, - dependencies: [boost_dep, openssl_dep, thread_dep, systemd_dep, wp_dep], + dependencies: service_dep, install: true, c_args : [ '-D_XOPEN_SOURCE=700', -- cgit 1.2.3-korg