Skip to content

Commit

Permalink
Add extra flag for catch2-based benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastinas committed Oct 10, 2023
1 parent 0fb8458 commit d025e52
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 27 deletions.
4 changes: 2 additions & 2 deletions faest_128f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_128f_bench', bench_sources,
dependencies: [libfaest_128f_dependency, boost_program_options],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
4 changes: 2 additions & 2 deletions faest_128s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_128s_bench', bench_sources,
dependencies: [libfaest_128s_dependency, boost_program_options],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
4 changes: 2 additions & 2 deletions faest_192f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
4 changes: 2 additions & 2 deletions faest_192s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_192s_bench', bench_sources,
dependencies: [libfaest_192s_dependency, boost_program_options],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
4 changes: 2 additions & 2 deletions faest_256f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_256f_bench', bench_sources,
dependencies: [libfaest_256f_dependency, boost_program_options],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
4 changes: 2 additions & 2 deletions faest_256s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_256s_bench', bench_sources,
dependencies: [libfaest_256s_dependency, boost_program_options],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
4 changes: 2 additions & 2 deletions faest_em_128f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_em_128f_bench', bench_sources,
dependencies: [libfaest_em_128f_dependency, boost_program_options],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
4 changes: 2 additions & 2 deletions faest_em_128s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_em_128s_bench', bench_sources,
dependencies: [libfaest_em_128s_dependency, boost_program_options],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
4 changes: 2 additions & 2 deletions faest_em_192f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_em_192f_bench', bench_sources,
dependencies: [libfaest_em_192f_dependency, boost_program_options],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
4 changes: 2 additions & 2 deletions faest_em_192s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_em_192s_bench', bench_sources,
dependencies: [libfaest_em_192s_dependency, boost_program_options],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
4 changes: 2 additions & 2 deletions faest_em_256f/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_em_256f_bench', bench_sources,
dependencies: [libfaest_em_256f_dependency, boost_program_options],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
4 changes: 2 additions & 2 deletions faest_em_256s/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ if openssl.found()
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_em_256s_bench', bench_sources,
dependencies: [libfaest_em_256s_dependency, boost_program_options],
Expand Down Expand Up @@ -76,7 +76,7 @@ if valgrind_exec.found()
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down
7 changes: 6 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ option('benchmarks',
value: 'auto',
description: 'Build benchmark executables'
)
option('catch2',
type: 'feature',
value: 'auto',
description: 'Use catch2 for benchmarks'
)
option('march-native',
type: 'feature',
value: 'disabled',
description: 'Build with -march=native'
)
)
4 changes: 2 additions & 2 deletions tools/crypto_sign_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def generate(param_name):
override_options: ['b_lto=false'],
)
endif
if boost_program_options.found()
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_{param_name}_bench', bench_sources,
dependencies: [libfaest_{param_name}_dependency, boost_program_options],
Expand Down Expand Up @@ -97,7 +97,7 @@ def generate(param_name):
build_by_default: false,
)
endif
if get_option('benchmarks').enabled()
if get_option('catch2').enabled() and get_option('benchmarks').enabled()
bench_sources = files(
join_paths(meson.project_source_root(), 'tools', 'bench_c2.cpp'),
)
Expand Down

0 comments on commit d025e52

Please sign in to comment.