mirror of
https://github.com/marzer/tomlplusplus.git
synced 2024-11-02 11:26:26 +00:00
ad4ae98af0
also: - made all wrapped array and table iterator internal conversions explicit - minor example code refactoring
47 lines
1.0 KiB
Meson
47 lines
1.0 KiB
Meson
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' ]
|
|
endif
|
|
if is_clang and get_option('asan_examples')
|
|
example_args += [ '-g3' ]
|
|
example_overrides += 'b_sanitize=address'
|
|
endif
|
|
|
|
examples = [
|
|
'simple_parser',
|
|
'toml_to_json_transcoder',
|
|
'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
|
|
if executable[0].contains('transcoder') # skip the transcoder because it waits on stdin
|
|
continue
|
|
endif
|
|
test(
|
|
executable[0], # name
|
|
executable[1], # executable object
|
|
workdir: meson.source_root()/'examples'
|
|
)
|
|
endforeach
|
|
endif
|