-
Notifications
You must be signed in to change notification settings - Fork 5
/
meson.build
141 lines (128 loc) · 3.55 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
project('remote-simgrid', 'cpp',
version: '0.3.0',
license: 'LGPL-3.0',
meson_version: '>=0.46.0',
default_options: [
'cpp_std=c++14',
# Do not use -Wl,--as-needed.
# librsg has a constructor and its link should always be kept.
'b_asneeded=false'
]
)
# Dependencies
boost_dep = dependency('boost', required: true)
docopt_dep = dependency('docopt', required: true)
protobuf_dep = dependency('protobuf', required : true)
protoc = find_program('protoc', required : true)
simgrid_dep = dependency('simgrid', required: true)
thread_dep = dependency('threads', required: true)
rsg_deps = [
boost_dep,
docopt_dep,
protobuf_dep,
simgrid_dep,
thread_dep
]
librsg_deps = [
protobuf_dep,
thread_dep
]
# Generate source files from protobuf schema description.
gen = generator(protoc, \
output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'],
arguments : [
'--proto_path=@CURRENT_SOURCE_DIR@',
'--cpp_out=@BUILD_DIR@',
'@INPUT@'
]
)
protobuf_generated_src = gen.process('rsg.proto')
# Source files
rsg_src = [
'src/common/assert.hpp',
'src/common/message.hpp',
'src/common/network/selector.hpp',
'src/common/network/selector.cpp',
'src/common/network/tcp_listener.hpp',
'src/common/network/tcp_listener.cpp',
'src/common/network/tcp_socket.hpp',
'src/common/network/tcp_socket.cpp',
'src/rsg/interthread_messaging.cpp',
'src/rsg/interthread_messaging.hpp',
'src/rsg/main.cpp',
'src/rsg/serve.cpp',
'src/rsg/serve.hpp',
'src/rsg/simulation.cpp',
'src/rsg/simulation.hpp',
'src/rsg/simple_commands.cpp',
'src/rsg/simple_commands.hpp',
]
librsg_src = [
'src/common/assert.hpp',
'src/common/message.hpp',
'src/common/network/tcp_socket.hpp',
'src/common/network/tcp_socket.cpp',
'src/librsg.hpp',
'src/librsg/actor.cpp',
'src/librsg/actor.hpp',
'src/librsg/comm.cpp',
'src/librsg/comm.hpp',
'src/librsg/condition_variable.cpp',
'src/librsg/condition_variable.hpp',
'src/librsg/connection.cpp',
'src/librsg/connection.hpp',
'src/librsg/engine.cpp',
'src/librsg/engine.hpp',
'src/librsg/host.cpp',
'src/librsg/host.hpp',
'src/librsg/mailbox.cpp',
'src/librsg/mailbox.hpp',
'src/librsg/mutex.cpp',
'src/librsg/mutex.hpp',
'src/librsg/pointers.hpp',
]
rsg_src += protobuf_generated_src
librsg_src += protobuf_generated_src
rsg_include_dir = include_directories('src/rsg')
rsg = executable('rsg', rsg_src,
include_directories: rsg_include_dir,
dependencies: rsg_deps,
install: true
)
librsg_include_dir = include_directories('src')
librsg = shared_library('rsg', librsg_src,
include_directories: librsg_include_dir,
dependencies: librsg_deps,
install: true,
)
# Install librsg.
install_headers(
'src/common/assert.hpp',
'src/librsg/actor.hpp',
'src/librsg/comm.hpp',
'src/librsg/condition_variable.hpp',
'src/librsg/connection.hpp',
'src/librsg/engine.hpp',
'src/librsg/host.hpp',
'src/librsg/log.hpp',
'src/librsg/mailbox.hpp',
'src/librsg/mutex.hpp',
'src/librsg/pointers.hpp',
subdir: 'librsg'
)
install_headers('src/librsg.hpp')
pkgc = import('pkgconfig')
pkgc.generate(name: 'librsg',
libraries: librsg,
version: meson.project_version(),
requires: [protobuf_dep],
extra_cflags: ['-pthread'],
description: 'Remote SimGrid client library.'
)
librsg_dep = declare_dependency(
include_directories: librsg_include_dir,
link_with: librsg,
dependencies: librsg_deps,
)
# Test
subdir('tests')