-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
82 lines (70 loc) · 1.92 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
project(
'libls',
['c'],
version: '0.0.0',
license: [
'ZLib',
],
default_options: [
'c_std=c11',
'prefix=/usr',
'sysconfdir=/etc',
'localstatedir=/var',
],
)
# Define our library ABI version at a global level.
abi_version_major = '0'
abi_version_minor = '0'
abi_version_micro = '0'
abi_version = '@0@.@1@.@2@'.format(abi_version_major,
abi_version_minor,
abi_version_micro)
am_cflags = [
'-fstack-protector',
'-Wall',
'-pedantic',
'-Wstrict-prototypes',
'-Wundef',
'-fno-common',
'-Werror-implicit-function-declaration',
'-Wformat',
'-Wformat-security',
'-Werror=format-security',
'-Wconversion',
'-Wunused-variable',
'-Wunreachable-code',
'-W',
]
# Get configuration bits together
path_prefix = get_option('prefix')
path_sysconfdir = join_paths(path_prefix, get_option('sysconfdir'))
# Sort out config.h now
cdata = configuration_data()
# General options..
cdata.set_quoted('PACKAGE_NAME', meson.project_name())
cdata.set_quoted('PACKAGE_VERSION', meson.project_version())
# Write config.h now
config_h = configure_file(
configuration: cdata,
output: 'config.h',
)
config_h_dir = include_directories('.')
with_tests = get_option('with-tests')
# Now go build the source
subdir('src')
if with_tests == true
dep_check = dependency('check', version: '>= 0.10.0')
subdir('tests')
endif
report = [
' Build configuration:',
' ====================',
'',
' prefix: @0@'.format(path_prefix),
' sysconfdir: @0@'.format(path_sysconfdir),
' enable tests: @0@'.format(with_tests),
]
if meson.is_subproject() == false
# Output some stuff to validate the build config
message('\n\n\n' + '\n'.join(report) + '\n\n')
endif