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
|
project('term', 'c',
version: '0.1.0',
meson_version: '>=1.1.0',
default_options: [
'c_std=c11',
'warning_level=3',
'b_ndebug=if-release',
],
)
cc = meson.get_compiler('c')
m_dep = cc.find_library('m', required: false)
if get_option('arch_flag') != ''
add_project_arguments(get_option('arch_flag'), language: 'c')
endif
# A host sees include/ only. The sources also find the public headers
# without the term/ prefix.
term_inc = include_directories('include')
term_private_inc = include_directories('src', 'include/term')
subdir('src')
term_dep = declare_dependency(
include_directories: term_inc,
link_with: term_headless_lib.get_static_lib(),
dependencies: m_dep,
)
meson.override_dependency('term', term_dep)
# The private headers too. Only the term tests and benchmarks use it.
term_internal_dep = declare_dependency(
include_directories: [term_inc, term_private_inc],
link_with: term_headless_lib.get_static_lib(),
dependencies: m_dep,
)
# The short forms of term.h that the term tests use. A host project can use
# them in its own tests.
term_test_dep = declare_dependency(
include_directories: include_directories('tests/helpers'),
dependencies: term_dep,
)
if get_option('tests')
subdir('tests')
subdir('benchmarks')
endif
|