initial virtual sensor with protobuf
This commit is contained in:
commit
cbee09be85
7 changed files with 326 additions and 0 deletions
sensor-query-cli
26
sensor-query-cli/meson.build
Normal file
26
sensor-query-cli/meson.build
Normal file
|
@ -0,0 +1,26 @@
|
|||
project('sensor-query-cli', 'cpp',
|
||||
default_options: ['cpp_std=c++20'])
|
||||
|
||||
protobuf_dep = dependency('protobuf')
|
||||
grpc_dep = dependency('grpc++', required: true)
|
||||
|
||||
proto_files = files('../sensor.proto')
|
||||
|
||||
protobuf_gen = custom_target(
|
||||
'generate_protobuf',
|
||||
input : proto_files,
|
||||
output : ['sensor.pb.cc', 'sensor.pb.h', 'sensor.grpc.pb.cc', 'sensor.grpc.pb.h'],
|
||||
command : [
|
||||
'protoc',
|
||||
'--proto_path=../../',
|
||||
'--cpp_out', '.',
|
||||
'--grpc_out', '.',
|
||||
'--plugin=protoc-gen-grpc=/usr/bin/grpc_cpp_plugin',
|
||||
'@INPUT@'
|
||||
],
|
||||
)
|
||||
|
||||
executable('sensor-query-cli',
|
||||
['main.cpp', protobuf_gen],
|
||||
dependencies: [protobuf_dep, grpc_dep]
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue