forked from vibe-d/vibe.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
121 lines (97 loc) · 3.04 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
project('Vibe.d', 'd',
meson_version: '>=0.40',
subproject_dir: 'lib/subprojects',
license: 'MIT',
version: '0.9.4'
)
project_soversion = '0'
project_version_suffix = ''
project_version = meson.project_version()
project_version_full = project_version + project_version_suffix
pkgc = import('pkgconfig')
#
# Dependencies
#
zlib_dep = dependency('zlib')
crypto_dep = dependency('libcrypto')
ssl_dep = dependency('libssl')
#
# Compiler flags
#
flag_new_openssl_ldc = []
flag_new_openssl_dmd = []
if ssl_dep.version().version_compare('>=1.1')
flag_new_openssl_ldc = '-d-version=VibeUseOpenSSL11'
flag_new_openssl_dmd = '-version=VibeUseOpenSSL11'
endif
if meson.is_subproject() == false
if meson.get_compiler('d').get_id() == 'llvm'
add_global_arguments(['-d-version=Have_openssl',
'-d-version=Have_diet_ng',
'-d-version=Have_stdx_allocator',
flag_new_openssl_ldc], language : 'd')
endif
if meson.get_compiler('d').get_id() == 'dmd'
add_global_arguments(['-version=Have_openssl',
'-version=Have_diet_ng',
'-version=Have_stdx_allocator',
flag_new_openssl_dmd], language : 'd')
endif
endif
if meson.get_compiler('d').get_id() == 'gnu'
error('Vibe.d can not be compiled with GDC at time (2016). Sorry.')
endif
#
# D dependencies
#
# we need to search for this dependency after setting global compiler flags, because
# it may pull in a subproject after which setting global flags is not allowed anymore
diet_dep = dependency('diet', fallback: ['diet', 'diet_dep'])
allocator_dep = dependency('stdx-allocator', fallback: ['stdx-allocator', 'allocator_dep'])
# directory where the external dependencies are included from.
# Meson will search for this dir in both build_root and source_root
subproject_dir = 'lib/subprojects'
# Try to find system OpenSSL bindings, if not found, download
# a Git copy.
openssl_src_dir = ''
if run_command('[', '-d', '/usr/include/d/common/deimos/openssl/', ']').returncode() == 0
openssl_src_dir = '/usr/include/d/common'
else
openssl_src_dir = subproject_dir + '/openssl'
if run_command('[', '-d', openssl_src_dir, ']').returncode() != 0
message('Fetching OpenSSL D bindings from Github...')
git_get_requests = run_command(['git', 'clone', 'https://github.com/s-ludwig/openssl.git', openssl_src_dir])
if git_get_requests.returncode() != 0
error('Unable to fetch OpenSSL bindings.\n' + git_get_requests.stderr())
endif
endif
message('Using non-system OpenSSL D bindings.')
endif
openssl_inc = include_directories(openssl_src_dir)
#
# Modules
#
# Utils
subdir('utils/')
# Data
subdir('data/')
# Crypto
subdir('crypto/')
# Stream
subdir('stream/')
# TextFilter
subdir('textfilter/')
# INet
subdir('inet/')
# TLS
subdir('tls/')
# HTTP
subdir('http/')
# Mail
subdir('mail/')
# MongoDB
subdir('mongodb/')
# Redis
subdir('redis/')
# Web
subdir('web/')