summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-02-20 13:33:19 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-02-20 14:05:33 +0530
commitb78f6f38f738d05d1c447ad991d158b355805e55 (patch)
tree054d31b3e76e353cc33a573b0fc7e19fe8a6174f /mesonbuild/compilers/c.py
parent37b702e9aa4255e1d0c5fa706e52842877cf01b3 (diff)
downloadmeson-nirbheek/stable-fix-pkgconfig-dependency-static.tar.gz
pkgconfig deps: Warn when a static library isn't foundnirbheek/stable-fix-pkgconfig-dependency-static
A hard error makes this feature useless in most cases since a static library usually won't be found for every library, particularly system libraries like -lm. Instead, warn so the user can provide the static library if they wish. This feature will be expanded and made more extensible and more usable in the future. Closes https://github.com/mesonbuild/meson/issues/2785
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r--mesonbuild/compilers/c.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index a59b7d384..1c9b9b4fa 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -780,9 +780,12 @@ class CCompiler(Compiler):
args = ['-l' + libname]
if self.links(code, env, extra_args=args):
return args
+ # Ensure that we won't modify the list that was passed to us
+ extra_dirs = extra_dirs[:]
+ # Search in the system libraries too
+ extra_dirs += self.get_library_dirs()
# Not found or we want to use a specific libtype? Try to find the
# library file itself.
- extra_dirs += self.get_library_dirs()
prefixes, suffixes = self.get_library_naming(env, libtype)
# Triply-nested loop!
for d in extra_dirs: