-
Notifications
You must be signed in to change notification settings - Fork 18
/
meson.build
102 lines (82 loc) · 2.01 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
project('mir-core', 'd', version : '1.1.1', license: 'Apache-2.0')
description = 'Mir Core - Base software building blocks and conventions'
subprojects = []
has_cpp_headers = false
dc = meson.get_compiler('d')
sources_list = [
'mir/algebraic',
'mir/bitmanip',
'mir/bitop',
'mir/checkedint',
'mir/complex/math',
'mir/complex/package',
'mir/conv',
'mir/enums',
'mir/exception',
'mir/functional',
'mir/internal/memory',
'mir/internal/meta',
'mir/internal/utility',
'mir/math/common',
'mir/math/constant',
'mir/math/ieee',
'mir/math/package',
'mir/primitives',
'mir/qualifier',
'mir/reflection',
'mir/string_table',
'mir/utility',
]
sources = []
foreach s : sources_list
sources += 'source/' + s + '.d'
endforeach
if dc.get_id() == 'gcc'
add_project_arguments([
'-fpreview=dip1008',
], language: 'd')
else
add_project_arguments([
'-preview=dip1008',
'-lowmem',
], language: 'd')
endif
required_deps = []
foreach p : subprojects
required_deps += dependency(p, fallback : [p, p.underscorify() + '_dep'])
endforeach
directories = ['source']
if has_cpp_headers
directories += 'include'
endif
directories = include_directories(directories)
this_lib = library(meson.project_name(),
sources,
include_directories: directories,
install: true,
version: meson.project_version(),
dependencies: required_deps,
)
this_dep = declare_dependency(
link_with: [this_lib],
include_directories: directories,
dependencies: required_deps,
)
test_versions = ['mir_core_test']
if has_cpp_headers
install_subdir('include/',
strip_directory :true,
install_dir: 'include/',
)
endif
install_subdir('source/',
strip_directory : true,
install_dir: 'include/d/' + meson.project_name(),
)
import('pkgconfig').generate(this_lib,
description: description,
subdirs: 'd/' + meson.project_name(),
)
mir_core_dep = this_dep
mir_core_lib = this_lib
test_subdirs = []