Fix ninja cannot find the library when libraries contain symlinks.

pull/12808/head
U2FsdGVkX1 9 months ago committed by GitHub
parent 6fcf8632c6
commit 91caf7aa56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 11
      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]:

Loading…
Cancel
Save