build(meson): use override_dependency if supported (#116)
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 :)
This commit is contained in:
parent
73870cef54
commit
fe28ec8d24
@ -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(),
|
||||
|
Loading…
Reference in New Issue
Block a user