Skip to content

Commit 1a8575f

Browse files
Tobias Hafnervogti
authored andcommitted
Configure building of prism api as separate library
1 parent 6596d25 commit 1a8575f

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

meson.build

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
project('polypheny_prism_api', 'cpp', default_options : ['cpp_std=c++17'])
2+
3+
# ========================
4+
# Dependencies
5+
# ========================
6+
7+
protobuf_subproject = subproject('protobuf')
8+
protobuf_dep = protobuf_subproject.get_variable('protobuf_dep')
9+
protoc = protobuf_subproject.get_variable('protoc')
10+
11+
# ========================
12+
# Protobuf Code Generation
13+
# ========================
14+
15+
prism_gen = generator(protoc,
16+
17+
arguments : [
18+
'--proto_path=@CURRENT_SOURCE_DIR@/prism',
19+
'--cpp_out=@BUILD_DIR@',
20+
'--experimental_allow_proto3_optional',
21+
'@INPUT@'
22+
]
23+
)
24+
25+
prism_files = files(
26+
'prism/connection_requests.proto',
27+
'prism/connection_responses.proto',
28+
'prism/document_frame.proto',
29+
'prism/error.proto',
30+
'prism/graph_frame.proto',
31+
'prism/meta_requests.proto',
32+
'prism/meta_responses.proto',
33+
'prism/namespace_meta_requests.proto',
34+
'prism/namespace_meta_responses.proto',
35+
'prism/protointerface.proto',
36+
'prism/relational_frame.proto',
37+
'prism/statement_requests.proto',
38+
'prism/statement_responses.proto',
39+
'prism/transaction_requests.proto',
40+
'prism/transaction_responses.proto',
41+
'prism/value.proto'
42+
)
43+
44+
# ========================
45+
# Library and Dependencies
46+
# ========================
47+
48+
prism_src = prism_gen.process(prism_files)
49+
50+
# TODO: find a clean way to specify the include dir for the generated protobuf code
51+
include_dirs = include_directories('../../buildDir/subprojects/polypheny_prism_api/libpolypheny_prism_api.a.p')
52+
53+
polypheny_prism_api_lib = static_library('polypheny_prism_api',
54+
prism_src,
55+
dependencies : [protobuf_dep],
56+
include_directories : include_dirs
57+
)
58+
59+
polypheny_prism_api_dep = declare_dependency(
60+
link_with: polypheny_prism_api_lib,
61+
include_directories: include_dirs,
62+
dependencies: [protobuf_dep],
63+
)

0 commit comments

Comments
 (0)