-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
78 lines (70 loc) · 1.49 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
project('args', 'c',
version : '1.1.1',
license : 'MIT',
default_options : [
'warning_level=3',
'optimization=3',
'strip=true',
'c_std=c99',
]
)
c_warnings = [
# warns
'-Wall',
'-Wextra',
'-Werror',
'-Wfatal-errors',
'-Wpedantic',
'-Wshadow',
'-Wdouble-promotion',
'-Wformat=2',
'-Wformat-overflow=2',
'-Wformat-truncation=1',
'-Wundef',
'-Wmissing-include-dirs',
'-Wstrict-aliasing=2',
'-Walloca',
'-Wduplicated-branches',
'-Wduplicated-cond',
'-Wwrite-strings',
'-Wdate-time',
'-Wsizeof-pointer-memaccess',
'-Wlogical-op',
'-Wpacked',
'-Wredundant-decls',
'-Wnested-externs',
'-Winline',
]
# These arguments are only used to build the shared library
# not the executables that use the library.
lib_args = [
'-DBUILDING_ARGS',
]
shlib = shared_library(
'args', 'args.c',
install : true,
c_args : [lib_args, c_warnings],
gnu_symbol_visibility : 'hidden',
)
example_basic_exe = executable(
'args_test', 'examples/basic.c',
link_with : shlib
)
test('example', example_basic_exe)
# Make this library usable as a Meson subproject.
test_dep = declare_dependency(
include_directories: include_directories('.'),
link_with : shlib
)
# Make this library usable from the system's
# package manager.
install_headers('args.h', subdir : 'args')
pkg_mod = import('pkgconfig')
pkg_mod.generate(
name : 'args',
filebase : 'args',
description : 'Simple args parsing',
subdirs : 'args',
libraries : shlib,
version : '1.1.1',
)