-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
75 lines (64 loc) · 1.4 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
project(
'cm4all-image-cloak',
'c',
version: '0.2',
meson_version: '>= 0.56',
default_options: [
'c_std=c17',
'warning_level=3',
],
)
compiler = meson.get_compiler('c')
common_cppflags = [
'-D_GNU_SOURCE',
]
test_global_common_flags = [
'-fvisibility=hidden',
]
test_common_flags = [
'-Wcast-qual',
'-Wcast-align',
'-Wdouble-promotion',
'-Wmissing-declarations',
'-Wmissing-format-attribute',
'-Wmissing-noreturn',
'-Wredundant-decls',
'-Wshadow',
'-Wundef',
'-Wvla',
'-Wwrite-strings',
# clang specific warning options:
'-Wunreachable-code-aggressive',
'-Wused-but-marked-unused',
]
test_global_cflags = test_global_common_flags + [
]
test_cflags = test_common_flags + [
]
test_ldflags = [
]
if get_option('buildtype') != 'debug'
test_global_cflags += [
'-ffunction-sections',
'-fdata-sections',
]
test_ldflags += [
'-Wl,--gc-sections',
'-Wl,--icf=all',
]
endif
add_global_arguments(common_cppflags, language: 'c')
add_global_arguments(compiler.get_supported_arguments(test_global_cflags), language: 'c')
add_project_arguments(compiler.get_supported_arguments(test_cflags), language: 'c')
add_project_link_arguments(compiler.get_supported_link_arguments(test_ldflags), language: 'c')
executable(
'cm4all-image-cloak',
'src/main.c',
'src/efi.c',
'src/hex.c',
'src/io.c',
dependencies: [
dependency('libsodium'),
],
install: true
)