tomlplusplus/examples/meson.build

51 lines
1.1 KiB
Meson
Raw Normal View History

example_args = []
example_args += additional_arguments
example_overrides = []
example_overrides += overrides
if is_gcc or is_clang
example_args += [ '-Wno-switch', '-Wno-switch-default', '-Wno-switch-enum' ]
2020-04-14 05:45:24 +00:00
endif
if is_clang and get_option('asan_examples')
example_args += [ '-g3' ]
example_overrides += 'b_sanitize=address'
endif
2020-04-14 05:45:24 +00:00
examples = [
2020-04-14 05:25:03 +00:00
'simple_parser',
'toml_to_json_transcoder',
2020-04-14 05:25:03 +00:00
'toml_generator',
'error_printer',
'parse_benchmark',
]
example_executables = []
foreach example : examples
example_executables += [[
example,
executable(
example,
[ example+'.cpp' ],
include_directories: include_dirs,
cpp_args: example_args,
override_options: example_overrides
)
]]
endforeach
if is_clang and get_option('asan_examples')
foreach executable : example_executables
2022-01-02 11:30:32 +00:00
# skip the transcoder (it waits on stdin) and the benchmark (might be slow and cause CI to fail)
if executable[0].contains('transcoder') or executable[0].contains('benchmark')
continue
endif
2022-01-02 11:30:32 +00:00
test(
executable[0], # name
executable[1], # executable object
workdir: meson.source_root()/'examples'
)
2022-01-02 11:30:32 +00:00
endforeach
endif