aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-12-10 18:01:02 -0800
committerDylan Baker <dylan@pnwbakers.com>2021-01-11 11:15:06 -0800
commit7248a64750fc0748f7d86b65e03172f00b515690 (patch)
tree831ea920d9882835e625f98f10aff158edd447a3
parent3949c2a0e0a5fbd9ede8e7a4607220e58934637e (diff)
downloadmeson-7248a64750fc0748f7d86b65e03172f00b515690.zip
meson-7248a64750fc0748f7d86b65e03172f00b515690.tar.gz
meson-7248a64750fc0748f7d86b65e03172f00b515690.tar.bz2
dependencies: Don't read PKG_CONFIG_PATH from the env again
We already read this in, don't read it again. Just rely on the value we have stored.
-rw-r--r--mesonbuild/dependencies/base.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 9ddf6db..9330e46 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -32,7 +32,6 @@ from pathlib import Path, PurePath
from .. import mlog
from .. import mesonlib
from ..compilers import clib_langs
-from ..envconfig import get_env_var
from ..environment import Environment, MachineInfo
from ..cmake import CMakeExecutor, CMakeTraceParser, CMakeException, CMakeToolchain, CMakeExecScope, check_cmake_args
from ..mesonlib import MachineChoice, MesonException, OrderedSet, PerMachine
@@ -317,7 +316,7 @@ class HasNativeKwarg:
return MachineChoice.BUILD if kwargs.get('native', False) else MachineChoice.HOST
class ExternalDependency(Dependency, HasNativeKwarg):
- def __init__(self, type_name, environment, kwargs, language: T.Optional[str] = None):
+ def __init__(self, type_name, environment: Environment, kwargs, language: T.Optional[str] = None):
Dependency.__init__(self, type_name, kwargs)
self.env = environment
self.name = type_name # default
@@ -784,14 +783,7 @@ class PkgConfigDependency(ExternalDependency):
#
# Only prefix_libpaths are reordered here because there should not be
# too many system_libpaths to cause library version issues.
- pkg_config_path = get_env_var(
- self.for_machine,
- self.env.is_cross_build(),
- 'PKG_CONFIG_PATH')
- if pkg_config_path:
- pkg_config_path = pkg_config_path.split(os.pathsep)
- else:
- pkg_config_path = []
+ pkg_config_path: T.List[str] = self.env.coredata.options[OptionKey('pkg_config_path', machine=self.for_machine)].value
pkg_config_path = self._convert_mingw_paths(pkg_config_path)
prefix_libpaths = sort_libpaths(prefix_libpaths, pkg_config_path)
system_libpaths = OrderedSet()