Skip to content

Commit

Permalink
dependencies/pkg-config: Add support for different cross_flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dcbaker committed Apr 4, 2019
1 parent c4de8c1 commit 54439d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mesonbuild/dependencies/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,10 @@ def _call_pkgbin(self, args, env=None):
else:
env = env.copy()

extra_paths = self.env.coredata.get_builtin_option('pkg_config_path')
if self.want_cross:
extra_paths = self.env.coredata.get_builtin_option('cross_pkg_config_path')
else:
extra_paths = self.env.coredata.get_builtin_option('pkg_config_path')
env['PKG_CONFIG_PATH'] = ':'.join([os.path.expanduser(os.path.expandvars(p))
for p in extra_paths])
fenv = frozenset(env.items())
Expand Down
5 changes: 5 additions & 0 deletions run_unittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5169,6 +5169,11 @@ def test_exe_wrapper_behaviour(self):
# Must run in-process or we'll get a generic CalledProcessError
self.run_tests(inprocess=True)

@skipIfNoPkgconfig
def test_cross_pkg_config_option(self):
testdir = os.path.join(self.unit_test_dir, '55 pkg_config_path option')
self.init(testdir, extra_args=['-Dcross_pkg_config_path=' + os.path.join(testdir, 'extra_path')])


class PythonTests(BasePlatformTests):
'''
Expand Down

0 comments on commit 54439d4

Please sign in to comment.