From 5b3617a43ee91d00ef050bb326bb9ebceb431f0e Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Wed, 22 Sep 2021 17:10:07 +0200 Subject: [PATCH] build(meson): use override_dependency if supported This improves user experience when using tomlplusplus as a Meson subproject. With this change users will be able to simply call dependency('tomlplusplus') and have Meson automatically resolve the dependency from the subproject if it is not found on the system. Without this, users always have to explicitly call dependency('tomlplusplus', fallback:['tomlplusplus','tomlplusplus_dep']) A lot of saved keystrokes :) --- meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meson.build b/meson.build index b0f77511..5394f58a 100644 --- a/meson.build +++ b/meson.build @@ -508,6 +508,10 @@ tomlplusplus_dep = declare_dependency( version: meson.project_version(), ) +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('tomlplusplus', tomlplusplus_dep) +endif + if not is_subproject import('pkgconfig').generate( name: meson.project_name(),