-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
63 lines (57 loc) · 1.44 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
project(
'pita_std',
'c',
version: run_command('cat', 'version', check: true).stdout().strip(),
license: 'GNU GPL version 3',
default_options: [ 'c_std=c11', 'warning_level=3' ], # ,'b_sanitize=address', 'buildtype=debug'
meson_version: '>=1.4.0',
)
c_args = [
'-Wall',
'-Werror',
# '-ansi',
'-W',
'-Wextra',
'-pedantic',
'-Wno-unused-function',
'-Wno-unused-but-set-variable',
'-O0',
'-g3',
'-lthread', # '-fsanitize=address,undefined'
]
unity_dep = dependency('unity')
# =========================== MAIN
sources = [
'src/pita_bool.c',
'src/pita_path.c',
'src/pita_string.c',
'src/pita_system.c',
'src/pita.c',
]
headers = include_directories('src')
pita_lib = shared_library('pita', sources, install: true)
pita_dep = declare_dependency(include_directories: headers, link_with: pita_lib)
install_headers(
'src/pita_bool.h',
'src/pita_path.h',
'src/pita_string.h',
'src/pita_system.h',
subdir: 'pita'
)
if meson.is_subproject() == false
tests_sources = [
'tests/main.c',
'tests/pita_string_tests.c',
'tests/pita_path_tests.c'
]
test_headers = include_directories('tests')
test_executable = executable(
'pita_test',
tests_sources,
dependencies: [ pita_dep, unity_dep ],
include_directories: [ test_headers, headers ],
link_with: pita_lib,
install: false
)
test('pita_test', test_executable)
endif