Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions mesonbuild/dependencies/pkgconfig.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2013-2021 The Meson development team
# Copyright 2013-2025 The Meson development team

from __future__ import annotations

Expand All @@ -15,6 +15,7 @@
from functools import lru_cache
import re
import os
import posixpath
import shlex
import typing as T

Expand Down Expand Up @@ -423,11 +424,11 @@ def _search_libs(self, libs_in: ImmutableListProtocol[str], raw_libs_in: Immutab
if not path_has_root(path):
# Resolve the path as a compiler in the build directory would
path = os.path.join(self.env.get_build_dir(), path)
prefix_libpaths.add(path)
prefix_libpaths.add(posixpath.normpath(path))
# Library paths are not always ordered in a meaningful way
#
# Instead of relying on pkg-config or pkgconf to provide -L flags in a
# specific order, we reorder library paths ourselves, according to th
# specific order, we reorder library paths ourselves, according to the
# order specified in PKG_CONFIG_PATH. See:
# https://github.com/mesonbuild/meson/issues/4271
#
Expand Down
2 changes: 1 addition & 1 deletion unittests/internaltests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2016-2021 The Meson development team
# Copyright 2016-2025 The Meson development team

from configparser import ConfigParser
from pathlib import Path
Expand Down
4 changes: 2 additions & 2 deletions unittests/linuxliketests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2016-2022 The Meson development team
# Copyright 2016-2025 The Meson development team

import stat
import subprocess
Expand Down Expand Up @@ -1167,7 +1167,7 @@ def test_pkgconfig_relative_paths(self):
self.assertTrue(relative_path_dep.found())

# Ensure link_args are properly quoted
libpath = Path(self.builddir) / '../relativepath/lib'
libpath = Path(self.builddir).parent / 'relativepath/lib'
link_args = ['-L' + libpath.as_posix(), '-lrelativepath']
self.assertEqual(relative_path_dep.get_link_args(), link_args)

Expand Down
Loading