meson: make use of override_dependency() if possible

This allows simplifying the subproject override to simply

```meson
dependency('libpkgconf')
```
pull/241/head
Dylan Baker 2021-11-11 18:39:56 -08:00 committed by Ariadne Conill
parent 72c59b89c6
commit 1044bb57ca
1 changed files with 7 additions and 1 deletions

View File

@ -78,6 +78,12 @@ dep_libpkgconf = declare_dependency(
include_directories : include_directories('.'),
)
# If we have a new enough meson override the dependency so that only
# `dependency('libpkgconf')` is required from the consumer
if meson.version().version_compare('>= 0.54.0')
meson.override_dependency('libpkgconf', dep_libpkgconf)
endif
pkg = import('pkgconfig')
pkg.generate(libpkgconf,
name : 'libpkgconf',
@ -113,4 +119,4 @@ install_man('man/pc.5')
install_man('man/pkgconf-personality.5')
install_data('pkg.m4', install_dir: 'share/aclocal')
install_data('AUTHORS', install_dir: 'share/doc/pkgconf')
install_data('README.md', install_dir: 'share/doc/pkgconf')
install_data('README.md', install_dir: 'share/doc/pkgconf')