-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
74 lines (65 loc) · 1.54 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
project('hrafn', 'cpp', 'objcpp', 'objc', default_options: [])
cpp_args = ['-march=native', '-std=c++23']
add_project_arguments(cpp_args, language: 'cpp')
objcpp_args = ['-std=c++20']
add_project_arguments(objcpp_args, language: 'objcpp')
is_debug = get_option('debug')
is_release = not is_debug
cxx = meson.get_compiler('cpp')
asio_dep = dependency('asio')
sodium_dep = dependency('libsodium')
protobuf_dep = dependency('protobuf')
absl_dep = dependency('absl', modules: ['absl::strings', 'absl::time'])
fmt_dep = dependency('fmt')
spdlog_dep = dependency('spdlog')
doctest_dep = dependency('doctest')
hrafn_inc = include_directories('.')
protoc = find_program('protoc', required: true)
protobuf_gen = generator(
protoc,
output: ['@[email protected]', '@[email protected]'],
arguments: [
'--proto_path=@SOURCE_ROOT@/proto',
'--cpp_out=@BUILD_DIR@',
'@INPUT@',
],
)
proto_generated = protobuf_gen.process('proto/messages.proto')
subdir('crypto')
subdir('utils')
subdir('net')
subdir('btle')
# executable(
# 'hrafn',
# files('src/hrafn.cpp'),
# proto_generated,
# dependencies: [
# asio_dep,
# sodium_dep,
# absl_dep,
# protobuf_dep,
# fmt_dep,
# spdlog_dep,
# crypto_dep,
# utils_dep,
# btle_dep,
# ],
# include_directories: [hrafn_inc],
# )
executable(
'bttest',
files('src/test.cpp'),
proto_generated,
dependencies: [
asio_dep,
sodium_dep,
absl_dep,
protobuf_dep,
fmt_dep,
spdlog_dep,
crypto_dep,
utils_dep,
btle_dep,
],
include_directories: [hrafn_inc],
)