forked from an-dr/microlog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
46 lines (37 loc) · 1.14 KB
/
meson.build
File metadata and controls
46 lines (37 loc) · 1.14 KB
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
project('microlog', 'c',
# Meson allows version to be a File object but treat first line only.
version: files('version'),
license: 'MIT',
default_options: ['warning_level=3'],
)
# ========================
# Library
# ========================
public_include = include_directories('include')
src = ['src/ulog.c']
# Treat sources as templates to replace version string
conf = configuration_data()
conf.set('ULOG_VERSION', meson.project_version())
ulog_h_cfg = configure_file(
input: 'include/ulog.h',
output: 'ulog.h',
configuration: conf,
)
ulog_c_cfg = configure_file(
input: 'src/ulog.c',
output: 'ulog.c',
configuration: conf,
)
# ========================
# Packaging
# ========================
install_headers(ulog_h_cfg, subdir: '')
install_data(ulog_c_cfg, install_dir: 'src')
install_data('meson/meson.build', install_dir: '.')
install_data('version', install_dir: '.')
install_data('LICENSE', install_dir: '.')
# ========================
# Dependency
# ========================
microlog_dep = declare_dependency(include_directories: public_include, sources: src)
meson.override_dependency(meson.project_name(), microlog_dep)