summaryrefslogtreecommitdiffstats
path: root/src/meson.build
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2023-08-24 15:39:24 -0400
committerScott Murray <scott.murray@konsulko.com>2023-08-24 15:42:30 -0400
commit0a1426d097688912188bcb59ff59d9c596e82b4d (patch)
tree8032edef0f8a6c3bbebe8f4382486f679bb2143f /src/meson.build
parentf0ac80936b73a44131564c4f65ecc0c9a9db7d39 (diff)
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 <scott.murray@konsulko.com> Change-Id: Ib1ec31af439a9b2d5244e2232ea7be1ed9a2574c
Diffstat (limited to 'src/meson.build')
-rw-r--r--src/meson.build61
1 files changed, 51 insertions, 10 deletions
diff --git a/src/meson.build b/src/meson.build
index 149ec99..40aaec8 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')
-cxx = meson.get_compiler('cpp')
-src = [ 'vis-config.cpp',
- 'vis-session.cpp',
- 'hvac-service.cpp',
- 'hvac-can-helper.cpp',
- 'hvac-led-helper.cpp',
- 'main.cpp'
+cpp = meson.get_compiler('cpp')
+grpcpp_reflection_dep = cpp.find_library('grpc++_reflection')
+
+service_dep = [
+ boost_dep,
+ dependency('glib-2.0'),
+ dependency('openssl'),
+ dependency('threads'),
+ dependency('libsystemd'),
+ 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',
+ 'HvacService.cpp',
+ 'HvacCanHelper.cpp',
+ 'HvacLedHelper.cpp',
+ 'main.cpp',
+ generated_protoc_sources,
+ generated_grpc_sources,
+]
+
executable('agl-service-hvac',
src,
- dependencies: [boost_dep, openssl_dep, thread_dep, systemd_dep],
+ dependencies: service_dep,
install: true,
install_dir : get_option('sbindir'))