summaryrefslogtreecommitdiffstats
path: root/applauncher/meson.build
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-09-10 12:31:13 -0400
committerScott Murray <scott.murray@konsulko.com>2022-09-10 12:42:02 -0400
commit560d902f4d2bf4ba3bb2edba6436080ee7d5a5ac (patch)
tree026c81383374b0b7ffbb867ab392ec7789f8ff45 /applauncher/meson.build
parenta2d991a54f77017ced1558d289bcb83d73fe2a35 (diff)
Add applaunchd gRPC API wrapper
Changes: - Add applaunchd gRPC API wrapper in applauncher directory, clients can include AppLauncherClient.h to use it. - To facilitate generating protobuf and gRPC code with protoc, switch from CMake to meson for building. While the code generation can be done in CMake, it is a lot more straightforward with meson, and if use of this library continues meson will be easier to maintain. Known issues: - The behavior of the client implementation here with respect to the server side (i.e. applaunchd) going away is currently robust, but could stand improvement with some further investigation. As the code stands, starting applications works when applaunchd becomes available again, but the streaming status RPC that is tied to window activation in the homescreen does not reconnect, and there seem to be some things that need to be resolved with respect to Qt object connection expiry to do so. If the Qt demos continue to be used in a significant fashion, this may be worth picking up. Bug-AGL: SPEC-4559 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I5cb480d4ce4d1cb944ebfd4114fb305f09f28ea3
Diffstat (limited to 'applauncher/meson.build')
-rw-r--r--applauncher/meson.build56
1 files changed, 56 insertions, 0 deletions
diff --git a/applauncher/meson.build b/applauncher/meson.build
new file mode 100644
index 0000000..b36184a
--- /dev/null
+++ b/applauncher/meson.build
@@ -0,0 +1,56 @@
+cpp = meson.get_compiler('cpp')
+grpcpp_reflection_dep = cpp.find_library('grpc++_reflection')
+
+qt5_dep = dependency('qt5', modules: ['Qml'])
+applauncher_dep = [
+ qt5_dep,
+ dependency('protobuf'),
+ dependency('grpc'),
+ dependency('grpc++'),
+ grpcpp_reflection_dep,
+]
+
+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@/protos',
+ '--cpp_out=@BUILD_DIR@',
+ '@INPUT@'])
+generated_protoc_sources = protoc_gen.process('protos/applauncher.proto')
+
+grpc_gen = generator(protoc, \
+ output : ['@BASENAME@.grpc.pb.cc', '@BASENAME@.grpc.pb.h'],
+ arguments : ['--proto_path=@CURRENT_SOURCE_DIR@/protos',
+ '--grpc_out=@BUILD_DIR@',
+ '--plugin=protoc-gen-grpc=' + grpc_cpp.path(),
+ '@INPUT@'])
+generated_grpc_sources = grpc_gen.process('protos/applauncher.proto')
+
+moc_files = qt5.compile_moc(headers : ['AppLauncherClient.h', 'AppLauncherGrpcClient.h'],
+ dependencies: qt5_dep)
+
+src = [
+ 'AppLauncherClient.cpp',
+ 'AppLauncherGrpcClient.cpp',
+ generated_protoc_sources,
+ generated_grpc_sources,
+ moc_files
+]
+lib = shared_library('qtappfw-applauncher',
+ sources: src,
+ version: '1.0.0',
+ soversion: '0',
+ dependencies: applauncher_dep,
+ install: true)
+
+install_headers('AppLauncherClient.h')
+
+pkg_mod = import('pkgconfig')
+pkg_mod.generate(libraries : lib,
+ version : '1.0',
+ name : 'libqtappfw-applauncher',
+ filebase : 'qtappfw-applauncher',
+ requires: 'Qt5Qml',
+ description : 'Library wrapping AGL AppLauncher API in Qt objects')