summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU2FsdGVkX1 <U2FsdGVkX1@gmail.com>2024-02-04 14:07:54 +0800
committerGitHub <noreply@github.com>2024-02-04 14:07:54 +0800
commit91caf7aa56ba622926f7056d4a42083a75c24e5a (patch)
treee8a0fac81fb01db4dc4309bc78b79f92efe434ff
parent6fcf8632c6ca7c7d3812bf611ca99820264fae65 (diff)
downloadmeson-91caf7aa56ba622926f7056d4a42083a75c24e5a.tar.gz
Fix ninja cannot find the library when libraries contain symlinks.
-rw-r--r--mesonbuild/compilers/mixins/gnu.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py
index 9c0c3f290..ef7f120f8 100644
--- a/mesonbuild/compilers/mixins/gnu.py
+++ b/mesonbuild/compilers/mixins/gnu.py
@@ -469,16 +469,13 @@ class GnuLikeCompiler(Compiler, metaclass=abc.ABCMeta):
# paths under /lib would be considered not a "system path",
# which is wrong and breaks things. Store everything, just to be sure.
pobj = pathlib.Path(p)
- unresolved = pobj.as_posix()
if pobj.exists():
+ resolved = pobj.resolve().as_posix()
+ if resolved not in result:
+ result.append(resolved)
+ unresolved = pobj.as_posix()
if unresolved not in result:
result.append(unresolved)
- try:
- resolved = pathlib.Path(p).resolve().as_posix()
- if resolved not in result:
- result.append(resolved)
- except FileNotFoundError:
- pass
return result
def get_compiler_dirs(self, env: 'Environment', name: str) -> T.List[str]: