-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
89 lines (88 loc) · 3.07 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
sources = configure_file(
input: '../crypto_sign.c.in',
output: 'crypto_sign.c',
configuration: param_192f
)
headers = [
configure_file(
input: '../crypto_sign.h.in',
output: 'crypto_sign.h',
configuration: param_192f
),
configure_file(
input: '../crypto_sign.h.in',
output: 'api.h',
configuration: param_192f
)
]
libfaest_192f = static_library('faest_192f',
sources,
dependencies: libfaest_static_dependency,
include_directories: include_directories,
c_args: defines + c_flags
)
install_headers(headers, subdir: 'faest_192f')
libfaest_192f_dependency = declare_dependency(
link_with: libfaest_192f,
include_directories: include_directories
)
if openssl.found()
tv_sources = files(
join_paths(meson.project_source_root(), 'randomness.c'),
join_paths(meson.project_source_root(), 'tools', 'rng.c'),
join_paths(meson.project_source_root(), 'tools', 'PQCgenKAT_sign.cpp')
)
test_vector_generator = executable('faest_192f_test_vectors', [sources] + tv_sources,
dependencies: [libfaest_no_random_static_dependency, openssl],
include_directories: include_directories,
c_args: defines + c_flags + ['-DHAVE_RANDOMBYTES'],
cpp_args: defines + cpp_flags + ['-DHAVE_RANDOMBYTES'],
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found() and get_option('benchmarks').enabled()
bench_sources = files(join_paths(meson.project_source_root(), 'tools', 'bench.cpp'))
bench = executable('faest_192f_bench', bench_sources,
dependencies: [libfaest_192f_dependency, boost_program_options],
include_directories: include_directories,
c_args: defines + c_flags,
cpp_args: defines + cpp_flags
)
endif
test_sources = files(join_paths(meson.project_source_root(), 'tests', 'api_test.c'))
faest_192f_test = executable('faest_192f_api_test', test_sources,
dependencies: [libfaest_192f_dependency, valgrind],
include_directories: include_directories,
c_args: defines + c_flags + valgrind_defines,
override_options: ['b_lto=false'],
)
test('faest_192f_api_test', faest_192f_test,
timeout: 6000,
)
if valgrind.found() and valgrind_exec.found()
test('faest_192f_api_test_ct', valgrind_exec,
args: ['-q', '--error-exitcode=1', '--track-origins=yes', faest_192f_test],
timeout: 6000,
)
endif
if valgrind_exec.found()
custom_target('faest_192f_memory_usage',
command: [valgrind_exec, '-q', '--error-exitcode=1', '--tool=massif', '--stacks=yes', '--massif-out-file=@OUTPUT@', faest_192f_test],
output: 'faest_192f.massif',
depends: [faest_192f_test],
install: false,
build_always_stale: true,
build_by_default: false,
)
endif
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
bench_catch = executable('faest_192f_bench_c2', bench_sources,
dependencies: [libfaest_192f_dependency, boost_program_options, catch2],
include_directories: include_directories,
c_args: defines + c_flags,
cpp_args: defines + cpp_flags
)
endif