diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-10-17 10:36:19 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2023-10-19 15:20:22 -0400 |
commit | bf9314e00dde4160b1022168cff91e09c868935c (patch) | |
tree | 95ac21e253359c1f434720a5ec21a4b0962bd19a /mesonbuild | |
parent | 7b7d2e060b447de9c2642848847370a58711ac1c (diff) | |
download | meson-bf9314e00dde4160b1022168cff91e09c868935c.zip meson-bf9314e00dde4160b1022168cff91e09c868935c.tar.gz meson-bf9314e00dde4160b1022168cff91e09c868935c.tar.bz2 |
pkgconfig: Allow setting both pkgconfig and pkg-config
This was previously allowed for different usage. Keep allowing it, but
with non fatal deprecation notice, and ignore the value from legacy
pkgconfig.
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/envconfig.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py index 5621b99..07f1229 100644 --- a/mesonbuild/envconfig.py +++ b/mesonbuild/envconfig.py @@ -404,12 +404,21 @@ class BinaryTable: if not isinstance(command, (list, str)): raise mesonlib.MesonException( f'Invalid type {command!r} for entry {name!r} in cross file') - if name == 'pkgconfig': - if 'pkg-config' in binaries: - raise mesonlib.MesonException('Both pkgconfig and pkg-config entries in machine file.') - mlog.deprecation('"pkgconfig" entry is deprecated and should be replaced by "pkg-config"') - name = 'pkg-config' self.binaries[name] = mesonlib.listify(command) + if 'pkgconfig' in self.binaries: + if 'pkg-config' not in self.binaries: + mlog.deprecation('"pkgconfig" entry is deprecated and should be replaced by "pkg-config"', fatal=False) + self.binaries['pkg-config'] = self.binaries['pkgconfig'] + elif self.binaries['pkgconfig'] != self.binaries['pkg-config']: + raise mesonlib.MesonException('Mismatched pkgconfig and pkg-config binaries in the machine file.') + else: + # Both are defined with the same value, this is allowed + # for backward compatibility. + # FIXME: We should still print deprecation warning if the + # project targets Meson >= 1.3.0, but we have no way to know + # that here. + pass + del self.binaries['pkgconfig'] @staticmethod def detect_ccache() -> T.List[str]: |