-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
64 lines (54 loc) · 1.64 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
project('ignore-gen', 'cpp',
version : '0.1.0',
meson_version: '>=0.56.0',
default_options : [
'warning_level=3',
'cpp_std=c++17'])
summary({'bindir': get_option('bindir'),
'libdir': get_option('libdir'),
'datadir': get_option('datadir'),
}, section: 'Directories')
summary({'buildtype': get_option('buildtype'),
}, section: 'Configuration')
# Configure project
install_prefix = get_option('prefix')
datadir = get_option('datadir')
is_package_build = get_option('package_build')
cdata = configuration_data()
if is_package_build
cdata.set_quoted('DB_FILE', join_paths(install_prefix, datadir, meson.project_name(), 'ignore.db'))
else
cdata.set_quoted('DB_FILE', join_paths(meson.project_source_root(), 'data', 'ignore.db'))
endif
cdata.set_quoted('PROGRAM_NAME', 'ignore-gen')
cdata.set_quoted('PROGRAM_VERSION', meson.project_version())
config_header = files('projconfig.h.in')
configure_file(configuration: cdata,
input: config_header,
output: 'projconfig.h')
config_include = include_directories('.')
# Check dependencies
sqlite_dep = dependency('sqlite3',
version: '>=3.36',
required: true)
fmt_dep = dependency('fmt',
version: '>=8.1',
required: true)
data_dl = find_program('scripts/download-data.py')
# Handle build targets
run_command(data_dl, check: true)
data_files = files('data/ignore.db')
install_data(data_files, install_mode: 'rw-r--r--')
gitignorio_srcs = files(
'src/main.cpp',
'src/IgnoreEntry.cpp',
'src/DbManager.cpp')
exe = executable('ignore-gen', gitignorio_srcs,
dependencies: [
sqlite_dep,
fmt_dep
],
include_directories: [
config_include
],
install : true)