Skip to content

Commit 89fb807

Browse files
hpkffteli-schwartz
andcommitted
Update dependencies/pkgconfig.py and tests
Co-authored-by: Eli Schwartz <eschwartz93@gmail.com>
1 parent 18703ea commit 89fb807

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

mesonbuild/dependencies/pkgconfig.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from functools import lru_cache
1616
import re
1717
import os
18+
import posixpath
1819
import shlex
1920
import typing as T
2021

@@ -423,7 +424,7 @@ def _search_libs(self, libs_in: ImmutableListProtocol[str], raw_libs_in: Immutab
423424
if not path_has_root(path):
424425
# Resolve the path as a compiler in the build directory would
425426
path = os.path.join(self.env.get_build_dir(), path)
426-
prefix_libpaths.add(Path(path).resolve().as_posix())
427+
prefix_libpaths.add(posixpath.normpath(path))
427428
# Library paths are not always ordered in a meaningful way
428429
#
429430
# Instead of relying on pkg-config or pkgconf to provide -L flags in a

unittests/allplatformstests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ def test_pkgconfig_gen_escaping(self):
21922192
kwargs = {'required': True, 'silent': True, 'native': MachineChoice.HOST}
21932193
foo_dep = PkgConfigDependency('libanswer', env, kwargs)
21942194
# Ensure link_args are properly quoted
2195-
libdir = Path(prefix, libdir).resolve()
2195+
libdir = PurePath(prefix) / PurePath(libdir)
21962196
link_args = ['-L' + libdir.as_posix(), '-lanswer']
21972197
self.assertEqual(foo_dep.get_link_args(), link_args)
21982198
# Ensure include args are properly quoted

unittests/internaltests.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,6 @@ def _call_pkgbin(self, args, env=None):
760760
instance_method.return_value = FakeInstance(env, MachineChoice.HOST, silent=True)
761761
kwargs = {'required': True, 'silent': True, 'native': MachineChoice.HOST}
762762
foo_dep = PkgConfigDependency('foo', env, kwargs)
763-
p1 = p1.resolve()
764-
p2 = p2.resolve()
765763
self.assertEqual(foo_dep.get_link_args(),
766764
[(p1 / 'libfoo.a').as_posix(), (p2 / 'libbar.a').as_posix()])
767765
bar_dep = PkgConfigDependency('bar', env, kwargs)

0 commit comments

Comments
 (0)