From 6c8f81333a34db54ccb23c063bb479c8e41f7d08 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 8 Aug 2018 04:08:32 +0530 Subject: PkgConfigDependency: Fix library path search order We were searching the library paths in the reverse order, which meant that we'd pick libraries from the wrong prefix. Closes https://github.com/mesonbuild/meson/issues/3951 --- mesonbuild/compilers/c.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mesonbuild/compilers') diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index ca50c52..312760e 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -16,6 +16,7 @@ import re import glob import os.path import subprocess +from pathlib import Path from .. import mlog from .. import coredata @@ -885,13 +886,13 @@ class CCompiler(Compiler): @classmethod def _get_trials_from_pattern(cls, pattern, directory, libname): - f = os.path.join(directory, pattern.format(libname)) + f = Path(directory) / pattern.format(libname) # Globbing for OpenBSD if '*' in pattern: # NOTE: globbing matches directories and broken symlinks # so we have to do an isfile test on it later - return cls._sort_shlibs_openbsd(glob.glob(f)) - return [f] + return cls._sort_shlibs_openbsd(glob.glob(str(f))) + return [f.as_posix()] @staticmethod def _get_file_from_list(files): -- cgit v1.1