Skip to content

Commit 5be8193

Browse files
committed
dependencies/pkgconfig: Return libpath as posix
1 parent 0ab9c3f commit 5be8193

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

mesonbuild/dependencies/pkgconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def _search_libs(self, libs_in: ImmutableListProtocol[str], raw_libs_in: Immutab
411411
if not os.path.isabs(path):
412412
# Resolve the path as a compiler in the build directory would
413413
path = os.path.join(self.env.get_build_dir(), path)
414-
prefix_libpaths.add(os.path.realpath(path))
414+
prefix_libpaths.add(Path(path).resolve().as_posix())
415415
# Library paths are not always ordered in a meaningful way
416416
#
417417
# 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
@@ -2045,7 +2045,7 @@ def test_pkgconfig_gen_escaping(self):
20452045
kwargs = {'required': True, 'silent': True}
20462046
foo_dep = PkgConfigDependency('libanswer', env, kwargs)
20472047
# Ensure link_args are properly quoted
2048-
libdir = PurePath(prefix) / PurePath(libdir)
2048+
libdir = Path(prefix, libdir).resolve()
20492049
link_args = ['-L' + libdir.as_posix(), '-lanswer']
20502050
self.assertEqual(foo_dep.get_link_args(), link_args)
20512051
# Ensure include args are properly quoted

unittests/internaltests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,8 @@ def _call_pkgbin(self, args, env=None):
661661
instance_method.return_value = FakeInstance(env, MachineChoice.HOST, silent=True)
662662
kwargs = {'required': True, 'silent': True}
663663
foo_dep = PkgConfigDependency('foo', env, kwargs)
664+
p1 = p1.resolve()
665+
p2 = p2.resolve()
664666
self.assertEqual(foo_dep.get_link_args(),
665667
[(p1 / 'libfoo.a').as_posix(), (p2 / 'libbar.a').as_posix()])
666668
bar_dep = PkgConfigDependency('bar', env, kwargs)

0 commit comments

Comments
 (0)