-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmeson.build
97 lines (67 loc) · 1.82 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
project('librdmapp', ['c', 'cpp'],
version: '1.0.0',
default_options: [
# 'werror=true',
'warning_level=3',
'c_std=c11',
'cpp_std=c++20',
])
add_project_arguments([
'-Wconversion',
# '-Wno-missing-field-initializers',
'-Wno-pedantic',
], language: ['c', 'cpp'])
project_mains = []
project_headers = []
project_sources = []
project_includes = [
include_directories('./')
]
thread_dep = dependency('threads', required : true)
cpp_compiler = meson.get_compiler('cpp')
numa_dep = cpp_compiler.find_library('numa', has_headers: ['numa.h'], required: true)
rdma_libs = [
cpp_compiler.find_library('rdmacm', has_headers: ['rdma/rdma_cma.h'], required: true),
cpp_compiler.find_library('ibverbs', has_headers: ['infiniband/verbs.h'], required: true),
]
rdma_dep = declare_dependency(dependencies: rdma_libs)
subdir('rdmapp')
project_deps = [
thread_dep,
numa_dep,
rdma_dep,
]
librdmapp = shared_library('rdmapp',
project_sources,
include_directories : project_includes,
dependencies: project_deps,
install : true
)
librdmapp_dep = declare_dependency(
include_directories : project_includes,
link_with : librdmapp
)
if not meson.is_subproject()
subdir('tests')
# test('all_tests',
# executable(
# 'run_tests',
# files(project_test_files),
# dependencies : [project_dep, test_dep],
# install : false
# )
# )
fs = import('fs')
foreach prog_src : project_mains
prog_name = fs.stem(prog_src)
link_args = []
main = executable(f'@prog_name@',
prog_src,
include_directories: project_includes,
link_args: link_args,
link_with: [librdmapp],
dependencies: project_deps
)
test(f'@prog_name@', main)
endforeach
endif