forked from nix-community/nixd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
74 lines (60 loc) · 1.74 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
project( 'nixd'
, ['c', 'cpp']
, default_options : ['cpp_std=gnu++20']
, version: 'nightly'
)
config_h = configuration_data()
git = find_program('git', required : false)
if git.found()
res = run_command(['git', 'describe', '--tags', '--always'], capture : true, check : false)
describe = res.stdout().strip()
config_h.set_quoted('NIXD_VCS_TAG', describe)
endif
config_h.set_quoted('NIXD_VERSION', meson.project_version())
config_h.set_quoted('NIXD_LIBEXEC', get_option('prefix') / get_option('libexecdir'))
configure_file(
output: 'nixd-config.h',
configuration: config_h,
)
cpp = meson.get_compiler('cpp')
add_project_arguments([
'-I' + meson.project_build_root(),
cpp.get_supported_arguments(
'-Werror=documentation',
'-Werror=delete-non-abstract-non-virtual-dtor',
'-Werror=pragma-once-outside-header',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
),
], language: 'cpp')
if get_option('buildtype').startswith('debug')
add_project_arguments([
cpp.get_supported_arguments(
'-Werror=return-type',
),
], language: 'cpp')
endif
if get_option('buildtype').startswith('release')
add_project_arguments([
cpp.get_supported_arguments(
'-Wno-return-type',
'-Wno-maybe-uninitialized',
'-Wno-unused-variable',
),
], language: 'cpp')
endif
gtest = dependency('gtest')
gtest_main = dependency('gtest_main')
llvm = dependency('llvm')
boost = dependency('boost')
fmt = dependency('fmt')
nlohmann_json = dependency('nlohmann_json')
backtrace = cpp.find_library('backtrace')
lit = find_program('lit', required: false)
pkgconfig = import('pkgconfig')
subdir('libbc')
subdir('lspserver')
subdir('libnixbc')
subdir('libnixf')
subdir('libnixt')
subdir('nixd')