diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2025-01-07 18:40:30 +0200 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2025-01-07 20:40:36 +0200 |
| commit | a4cb40bde488cc548e39fbd2e536e25a833f2484 (patch) | |
| tree | 0814020101f3b41653996dce651953e1432ef65b | |
| parent | 4379ca1ca729f2ccc7793d4e234bf8e078caa68d (diff) | |
| download | meson-a4cb40bde488cc548e39fbd2e536e25a833f2484.tar.gz | |
Only use uninstalled deps if a build dir exists.
| -rw-r--r-- | mesonbuild/dependencies/pkgconfig.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/pkgconfig.py b/mesonbuild/dependencies/pkgconfig.py index c6e6a5e4f..447b69ea0 100644 --- a/mesonbuild/dependencies/pkgconfig.py +++ b/mesonbuild/dependencies/pkgconfig.py @@ -258,9 +258,12 @@ class PkgConfigCLI(PkgConfigInterface): key = OptionKey('pkg_config_path', machine=self.for_machine) extra_paths: T.List[str] = self.env.coredata.optstore.get_value(key)[:] if uninstalled: - uninstalled_path = Path(self.env.get_build_dir(), 'meson-uninstalled').as_posix() - if uninstalled_path not in extra_paths: - extra_paths.insert(0, uninstalled_path) + bpath = self.env.get_build_dir() + if bpath is not None: + # uninstalled can only be used if a build dir exists. + uninstalled_path = Path(bpath, 'meson-uninstalled').as_posix() + if uninstalled_path not in extra_paths: + extra_paths.insert(0, uninstalled_path) env.set('PKG_CONFIG_PATH', extra_paths) sysroot = self.env.properties[self.for_machine].get_sys_root() if sysroot: |
