mirror of
https://github.com/pantor/inja.git
synced 2026-03-18 06:55:57 +00:00
fix: Add option to disable tests and benchmarks with Meson (#216)
Co-authored-by: Benedikt Bastin <benedikt@benedikt-bastin.de>
This commit is contained in:
47
meson.build
47
meson.build
@@ -1,16 +1,11 @@
|
||||
project('inja', 'cpp', default_options: ['cpp_std=c++17'])
|
||||
|
||||
|
||||
#option('build_tests', type: 'boolean', value: true)
|
||||
#option('build_benchmark', type: 'boolean', value: true)
|
||||
|
||||
|
||||
inja_dep = declare_dependency(
|
||||
include_directories: include_directories('include', 'third_party/include')
|
||||
)
|
||||
|
||||
|
||||
|
||||
amalg_script = files('scripts/update_single_include.sh')
|
||||
|
||||
amalg_files = files(
|
||||
@@ -23,27 +18,29 @@ amalg_tgt = run_target( 'amalg',
|
||||
command: amalg_script
|
||||
)
|
||||
|
||||
if get_option('build_tests')
|
||||
inja_test = executable(
|
||||
'inja_test',
|
||||
'test/test.cpp',
|
||||
dependencies: inja_dep
|
||||
)
|
||||
|
||||
inja_test = executable(
|
||||
'inja_test',
|
||||
'test/test.cpp',
|
||||
dependencies: inja_dep
|
||||
)
|
||||
inja_single_test = executable(
|
||||
'inja_single_test',
|
||||
'test/test.cpp',
|
||||
'single_include/inja/inja.hpp',
|
||||
dependencies: [inja_dep]
|
||||
)
|
||||
|
||||
inja_single_test = executable(
|
||||
'inja_single_test',
|
||||
'test/test.cpp',
|
||||
'single_include/inja/inja.hpp',
|
||||
dependencies: [inja_dep]
|
||||
)
|
||||
test('Inja unit test', inja_test)
|
||||
test('Inja single include test', inja_single_test)
|
||||
endif
|
||||
|
||||
|
||||
inja_benchmark = executable(
|
||||
'inja_benchmark',
|
||||
'test/benchmark.cpp',
|
||||
dependencies: inja_dep
|
||||
)
|
||||
|
||||
|
||||
test('Inja unit test', inja_test)
|
||||
test('Inja single include test', inja_single_test)
|
||||
if get_option('build_benchmark')
|
||||
inja_benchmark = executable(
|
||||
'inja_benchmark',
|
||||
'test/benchmark.cpp',
|
||||
dependencies: inja_dep
|
||||
)
|
||||
endif
|
||||
|
||||
2
meson_options.txt
Normal file
2
meson_options.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
option('build_tests', type: 'boolean', value: true)
|
||||
option('build_benchmark', type: 'boolean', value: true)
|
||||
Reference in New Issue
Block a user