aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-05-02 11:20:16 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2022-05-04 00:16:32 +0300
commit5a34dcedf729ac449de97fe7d201c1ebc50cd1d4 (patch)
tree3b593491f687ee61a97e52f11dcae6db69364188
parent2f68aa21e87f451196bb050315e268cb38f200c5 (diff)
downloadmeson-5a34dcedf729ac449de97fe7d201c1ebc50cd1d4.zip
meson-5a34dcedf729ac449de97fe7d201c1ebc50cd1d4.tar.gz
meson-5a34dcedf729ac449de97fe7d201c1ebc50cd1d4.tar.bz2
devenv: Use PkgConfigDependency.get_env()
This ensures that PKG_CONFIG_PATH, PKG_CONFIG_LIBDIR and PKG_CONFIG_SYSROOT_DIR are also set properly.
-rw-r--r--mesonbuild/mdevenv.py4
-rw-r--r--mesonbuild/msetup.py4
2 files changed, 3 insertions, 5 deletions
diff --git a/mesonbuild/mdevenv.py b/mesonbuild/mdevenv.py
index 8ea50d5..27533e3 100644
--- a/mesonbuild/mdevenv.py
+++ b/mesonbuild/mdevenv.py
@@ -33,10 +33,6 @@ def get_env(b: build.Build, build_dir: str) -> T.Tuple[T.Dict[str, str], T.Set[s
extra_env.set('MESON_DEVENV', ['1'])
extra_env.set('MESON_PROJECT_NAME', [b.project_name])
- meson_uninstalled = Path(build_dir) / 'meson-uninstalled'
- if meson_uninstalled.is_dir():
- extra_env.prepend('PKG_CONFIG_PATH', [str(meson_uninstalled)])
-
env = os.environ.copy()
varnames = set()
for i in itertools.chain(b.devenv, {extra_env}):
diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py
index 6e03540..2a15e13 100644
--- a/mesonbuild/msetup.py
+++ b/mesonbuild/msetup.py
@@ -28,7 +28,8 @@ from . import environment, interpreter, mesonlib
from . import build
from . import mlog, coredata
from . import mintro
-from .mesonlib import MesonException
+from .mesonlib import MesonException, MachineChoice
+from .dependencies import PkgConfigDependency
git_ignore_file = '''# This file is autogenerated by Meson. If you change or delete it, it won't be recreated.
*
@@ -290,6 +291,7 @@ class MesonApp:
def _finalize_devenv(self, b: build.Build, intr: interpreter.Interpreter) -> None:
b.devenv.append(intr.backend.get_devenv())
+ b.devenv.append(PkgConfigDependency.get_env(intr.environment, MachineChoice.HOST, uninstalled=True))
for mod in intr.modules.values():
devenv = mod.get_devenv()
if devenv: