Skip to content

Commit

Permalink
envconfig: add pkg_config_path property
Browse files Browse the repository at this point in the history
In order to unify the use of sysroot in the cross-file,
the pkg_config_path can now be passed directly in the file.
  • Loading branch information
Stéphane Cerveau committed Jan 14, 2020
1 parent 71bbcc7 commit b7669c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mesonbuild/dependencies/base.py
Expand Up @@ -693,7 +693,12 @@ def _call_pkgbin(self, args, env=None):
sysroot = self.env.properties[self.for_machine].get_sys_root()
if sysroot:
env['PKG_CONFIG_SYSROOT_DIR'] = sysroot
new_pkg_config_path = ':'.join([p for p in extra_paths])
pkg_config_path_prop = self.env.properties[self.for_machine].get_pkg_config_path()

if pkg_config_path_prop:
new_pkg_config_path = ':'.join([p for p in pkg_config_path_prop])
else:
new_pkg_config_path = ':'.join([p for p in extra_paths])
mlog.debug('PKG_CONFIG_PATH: ' + new_pkg_config_path)
env['PKG_CONFIG_PATH'] = new_pkg_config_path

Expand Down
3 changes: 3 additions & 0 deletions mesonbuild/envconfig.py
Expand Up @@ -140,6 +140,9 @@ def get_root(self) -> T.Optional[T.Union[str, T.List[str]]]:
def get_sys_root(self) -> T.Optional[T.Union[str, T.List[str]]]:
return self.properties.get('sys_root', None)

def get_pkg_config_path(self) -> T.Optional[T.Union[str, T.List[str]]]:
return self.properties.get('pkg_config_path', None)

def __eq__(self, other: T.Any) -> 'T.Union[bool, NotImplemented]':
if isinstance(other, type(self)):
return self.properties == other.properties
Expand Down

0 comments on commit b7669c6

Please sign in to comment.