-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathmeson.build
101 lines (86 loc) · 2.28 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
98
99
100
101
project(
'rmw',
'c',
version: '0.9.4-dev',
meson_version: '>= 0.59.0',
default_options: [
'warning_level=3',
'b_sanitize=address,undefined',
'b_lundef=false',
'pkg_config_path=/opt/homebrew/opt/gettext/lib/pkgconfig,/opt/homebrew/opt/ncurses/lib/pkgconfig,/usr/local/opt/ncurses/lib/pkgconfig',
],
)
cc = meson.get_compiler('c')
host_sys = host_machine.system()
extra_flags = [
'-fno-common',
'-fstack-protector-strong',
'-Wformat-security',
'-Wformat-overflow=2',
'-Wshadow',
'-Wstrict-overflow=5',
'-Werror=odr',
'-Werror=lto-type-mismatch',
'-Werror=strict-aliasing',
# '-Wconversion'
]
add_project_arguments(cc.get_supported_arguments(extra_flags), language: 'c')
meson.add_devenv({'RMW_LOCALEDIR': join_paths(meson.project_build_root(), 'po')})
conf = configuration_data()
conf.set_quoted('VERSION', meson.project_version())
conf.set_quoted('PACKAGE_STRING', meson.project_name())
conf.set_quoted(
'PACKAGE_URL',
'https://theimpossibleastronaut.github.io/rmw-website/',
)
conf.set_quoted(
'PACKAGE_BUGREPORT',
'https://github.com/theimpossibleastronaut/rmw/issues',
)
check_headers = [
['ncursesw/menu.h', 'HAVE_NCURSESW_MENU_H'],
['ncurses/menu.h', 'HAVE_NCURSES_MENU_H'],
['menu.h', 'HAVE_MENU_H'],
['ncursesw/curses.h', 'HAVE_NCURSESW_CURSES_H'],
['ncursesw.h', 'HAVE_NCURSESW_H'],
['ncurses/curses.h', 'HAVE_NCURSES_CURSES_H'],
['ncurses.h', 'HAVE_NCURSES_H'],
['curses.h', 'HAVE_CURSES_H'],
]
foreach h : check_headers
if cc.has_header(h[0])
conf.set(h[1], 1)
endif
endforeach
localedir = join_paths(get_option('prefix'), get_option('localedir'))
subdir('po')
# https://mesonbuild.com/Subprojects.html
canfigger_dep = dependency(
'canfigger',
version: '>=0.3.0',
fallback: ['canfigger', 'canfigger_dep'],
default_options: 'default_library=static',
)
subdir('src')
main_bin = executable('rmw', 'src/main.c', dependencies: rmw_dep, install: true)
subdir('man')
if get_option('build_tests')
subdir('test')
endif
install_data(
files(
'AUTHORS.md',
'COPYING',
'ChangeLog',
'README.md',
'ReleaseNotes',
'rmwrc.example',
),
install_dir: get_option('docdir'),
)
# Copy completions to docdir
install_subdir(
'completions',
install_dir: join_paths(get_option('docdir')),
strip_directory: false,
)