From a4cb40bde488cc548e39fbd2e536e25a833f2484 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Tue, 7 Jan 2025 18:40:30 +0200 Subject: Only use uninstalled deps if a build dir exists. --- mesonbuild/dependencies/pkgconfig.py | 9 ++++++--- 1 file 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: -- cgit v1.2.3