Repository navigation
Expand file tree
/
Copy pathmeson.build
More file actions
63 lines (52 loc) · 1.79 KB
/
Copy pathmeson.build
File metadata and controls
63 lines (52 loc) · 1.79 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
54
55
56
57
58
59
60
61
62
63
project('cblk', ['c', 'cpp'])
cblk_deps = []
cblk_args = []
conf = configuration_data()
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',
])
if get_option('rs_encode')
conf.set('RS_ENCODE', 1)
cblk_src += files([
'src/ccsds_randomize.c',
'src/rs_encode.c',
])
endif
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('.', 'include')
libcblk_h = configure_file(output: 'libcblk.h', configuration: conf)
cblk_lib = static_library('cblk',
sources: [cblk_src, libcblk_h],
include_directories : [cblk_inc],
dependencies : cblk_deps,
c_args : cblk_args,
install : false
)
cblk_dep = declare_dependency(
include_directories : cblk_inc,
link_with : cblk_lib,
dependencies: cblk_deps,
)