build: Refactor the build structure of the project
Moved all header files to `include` and all cpp files to `src`.
Updated the meson.build accordingly.
Change-Id: I9e26197b9c73b5e284cfc9d0d78a234546c282ad
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/proto/meson.build b/proto/meson.build
index 0600083..02d46d9 100644
--- a/proto/meson.build
+++ b/proto/meson.build
@@ -1,4 +1,4 @@
-proto = custom_target(
+src_pb = custom_target(
'proto',
command: [
find_program('protoc', native: true),
@@ -11,3 +11,20 @@
'binaryblob.pb.h',
],
input: 'binaryblob.proto')
+
+binaryblobproto_pre = declare_dependency(
+ include_directories: include_directories('.'),
+ dependencies: dependency('protobuf')
+)
+
+binaryblobproto_lib = static_library(
+ 'binaryblob_proto',
+ src_pb,
+ implicit_include_directories: false,
+ dependencies: binaryblobproto_pre
+)
+
+binaryblobproto_dep = declare_dependency(
+ dependencies: binaryblobproto_pre,
+ link_with: binaryblobproto_lib
+)