forked from pktgen/Pktgen-DPDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
85 lines (69 loc) · 2.08 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
project('pktgen', 'C',
version: run_command(find_program('cat', 'more'),
files('VERSION'), check:false).stdout().strip(),
license: 'BSD',
default_options: [
'buildtype=release',
'default_library=static',
'warning_level=3',
'werror=true'
],
meson_version: '>= 0.47.1'
)
pktgen_conf = configuration_data()
# set up some global vars for compiler, platform, configuration, etc.
cc = meson.get_compiler('c')
target = target_machine.cpu_family()
if (target != 'riscv64')
add_project_arguments('-march=native', language: 'c')
endif
if get_option('enable-avx') and cc.has_argument('-mavx')
add_project_arguments('-mavx', language: 'c')
endif
if get_option('enable-avx2') and cc.has_argument('-mavx2')
add_project_arguments('-mavx2', language: 'c')
endif
add_project_arguments('-DALLOW_EXPERIMENTAL_API', language: 'c')
add_project_arguments('-D_GNU_SOURCE', language: 'c')
# enable extra warnings and disable any unwanted warnings
warning_flags = [
'-Wno-pedantic',
'-Wno-format-truncation',
]
foreach arg: warning_flags
if cc.has_argument(arg)
add_project_arguments(arg, language: 'c')
endif
endforeach
lua_dep = dependency('', required: false)
if get_option('enable_lua')
message('>>>>>>>>>>>>> Lua enabled <<<<<<<<<<<<<<')
add_project_arguments('-DLUA_ENABLED', language: 'c')
lua_names = ['lua', 'lua-5.3', 'lua5.3', 'lua-5.4', 'lua5.4']
foreach n:lua_names
lua_dep = dependency(n, required: false)
if not lua_dep.found()
lua_dep = cc.find_library(n, required: false)
endif
if lua_dep.found()
break
endif
endforeach
if not lua_dep.found()
error('unable to find Lua')
endif
endif
if get_option('only_docs')
subdir('tools')
subdir('doc')
else
dpdk = dependency('libdpdk', required: true)
# message('prefix: ' + get_option('prefix') + ' libdir: ' + get_option('libdir'))
dpdk_libs_path = join_paths(get_option('prefix'), get_option('libdir'))
# message('DPDK lib path: ' + dpdk_libs_path)
dpdk_bond = cc.find_library('librte_net_bond', dirs: [dpdk_libs_path], required: false)
subdir('tools')
subdir('lib')
subdir('app')
subdir('doc')
endif