-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmeson.build
More file actions
53 lines (44 loc) · 1.56 KB
/
meson.build
File metadata and controls
53 lines (44 loc) · 1.56 KB
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
project('cblk', ['c', 'cpp'])
cblk_deps = []
cblk_args = []
if not meson.is_subproject()
csp_dep = dependency('csp', fallback : ['csp', 'csp_dep'], required: true).partial_dependency(links: true, includes: true)
param_dep = dependency('param', fallback: ['param', 'param_dep'], required: true).partial_dependency(links: true, includes: true)
else
csp_dep = dependency('csp', fallback : ['csp', 'csp_dep'], required: true).partial_dependency(links: false, includes: true)
param_dep = dependency('param', fallback: ['param', 'param_dep'], required: true).partial_dependency(links: false, includes: true)
endif
cblk_deps += [csp_dep, param_dep]
cblk_src = files([
'src/csp_if_cblk.c',
'src/crypto/crypto.c',
'src/crypto/crypto_param.c',
])
nacl_impl = get_option('nacl_impl')
if nacl_impl == 'tweetnacl'
cblk_src += 'src/crypto/tweetnacl.c'
cblk_args += '-DUSE_TWEETNACL'
elif nacl_impl == 'sodium'
if meson.is_cross_build()
sodium_proj = subproject('sodium', required: true)
sodium_dep = sodium_proj.get_variable('sodium_dep')
else
sodium_dep = dependency('libsodium', required: true)
endif
cblk_deps += sodium_dep
cblk_args += '-DUSE_SODIUM'
endif
cblk_inc = include_directories('src')
api = include_directories('include')
cblk_lib = static_library('cblk',
sources: [cblk_src],
include_directories : [cblk_inc, api],
dependencies : cblk_deps,
c_args : cblk_args,
install : false
)
cblk_dep = declare_dependency(
include_directories : api,
link_with : cblk_lib,
dependencies: cblk_deps,
)