tomlplusplus/toml-test/meson.build
Andrea Pappacoda 36030cace8 build(meson): use system deps when avalable
When building tests, Meson will now look for system dependencies and use
them if found. Otherwise, it will check if the submodules are cloned and
create a dependency object wrapping the include path of each external
dependency (this breaks Meson's sandbox, but the previous approach did
too). This also allows passing actual dependencies to the various build
targets instead of include paths (a bit more idiomatic).

I've also made it possible to skip the tl-optional tests when the lib is
not found, so that it is still possible to run tests even from a
tarball (i.e. no git checkout)
2022-02-17 22:45:07 +02:00

23 lines
385 B
Meson

tt_deps = [
tomlplusplus_dep,
dependency('nlohmann_json', fallback: ['json', 'nlohmann_json_dep'])
]
if get_option('build_tt_encoder')
executable(
'tt_encoder',
'tt_encoder.cpp',
cpp_args: devel_args,
dependencies: tt_deps
)
endif
if get_option('build_tt_decoder')
executable(
'tt_decoder',
'tt_decoder.cpp',
cpp_args: devel_args,
dependencies: tt_deps
)
endif