-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathmeson.build
More file actions
80 lines (71 loc) · 1.85 KB
/
meson.build
File metadata and controls
80 lines (71 loc) · 1.85 KB
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
project('rex-compile',
['c', 'cpp'],
version: '0.1.0',
default_options : [
'buildtype=debugoptimized',
'warning_level=2',
'werror=true',
'b_lto=true',
'b_lto_mode=thin',
'b_pie=true',
'c_std=gnu23',
'cpp_std=c++23'
]
)
add_project_arguments(
[
'-pipe',
'-march=native',
'-ffunction-sections',
'-fdata-sections',
'-fno-semantic-interposition'
],
language: ['c', 'cpp']
)
add_project_link_arguments(
[
'-Wl,-O1',
'-Wl,--gc-sections',
'-Wl,-z,now',
'-Wl,-z,relro'
],
language: ['c', 'cpp']
)
bindgen = find_program('bindgen')
cmake = find_program('cmake')
ninja = find_program('ninja')
perl = find_program('perl')
python3_bin = find_program('python3', version: '>=3.11')
realpath = find_program('realpath')
lld = find_program('ld.lld')
bc = find_program('bc')
flex = find_program('flex')
bison = find_program('bison')
subdir('linux')
subdir('librex')
rust_bootstrap_config = files('./rust/rex-config.toml')
rust_bootstrap = custom_target(
'rust',
output : ['cargo', 'rustc'],
command: [
python3_bin, '@SOURCE_ROOT@/rust/x.py', 'install',
'--config=@SOURCE_ROOT@/rust/rex-config.toml',
'--build-dir=@OUTDIR@/rust-build',
'--set', 'install.prefix=@OUTDIR@/rust-dist'
],
console: true,
build_by_default: false,
env: ['RUSTFLAGS=-C link-arg=-fuse-ld=mold']
)
all_programs = custom_target('build_deps',
output: ['kernel', 'kernel_libbpf', 'rust'],
command: ['echo', 'Build all depends'],
depends: [kernel_build, kernel_libbpf, rust_bootstrap],
console: true
)
rust_bin = join_paths(meson.current_build_dir(), 'rust-dist/bin')
cargo_wrapper = join_paths(meson.project_source_root(), 'scripts/cargo-wrapper.pl')
sanity_test_scripts = join_paths(meson.project_source_root(), 'scripts/sanity_tests/run_tests.py')
runtest_deps = []
subdir('samples')
subdir('rex')