-
Notifications
You must be signed in to change notification settings - Fork 57
/
meson.build
73 lines (63 loc) · 1.53 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
project('dparse', 'd',
meson_version: '>=0.44',
license: 'BSL-1.0',
version: '0.10.4'
)
project_soversion = '0'
pkgc = import('pkgconfig')
#
# Sources
#
dparse_src = [
'src/dparse/ast.d',
'src/dparse/entities.d',
'src/dparse/formatter.d',
'src/dparse/lexer.d',
'src/dparse/parser.d',
'src/dparse/rollback_allocator.d',
'src/dparse/stack_buffer.d',
'src/dparse/trivia.d',
'src/std/experimental/lexer.d',
]
src_dir = include_directories('src/')
#
# Targets
#
dparse_lib = library('dparse',
[dparse_src],
include_directories: [src_dir],
install: true,
version: meson.project_version(),
soversion: project_soversion
)
pkgc.generate(name: 'dparse',
libraries: [dparse_lib],
subdirs: 'd/dparse',
version: meson.project_version(),
description: 'Library for lexing and parsing D source code.'
)
# for use by others which embed this as subproject
dparse_dep = declare_dependency(
link_with: [dparse_lib],
include_directories: [src_dir]
)
#
# Tests
#
if meson.get_compiler('d').get_id() == 'llvm'
extra_args = ['-main', '-link-defaultlib-shared']
else
extra_args = ['-main']
endif
dparse_test_exe = executable('test_dparse',
[dparse_src],
include_directories: [src_dir],
d_unittest: true,
link_args: extra_args,
)
test('test_dparse', dparse_test_exe)
#
# Install
#
install_subdir('src/dparse/', install_dir: 'include/d/dparse/')
install_subdir('src/std/', install_dir: 'include/d/dparse/')