aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-10-08 17:11:29 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2017-10-08 17:25:08 +0300
commit2fbc857ff4592b55acb8f4788d39c9f0fa0928dd (patch)
tree9dc6e2584fb9710affd43b8d3031e6e858cbbf98
parent8b8e1ee620ad170fc32fbabc362827ed53332186 (diff)
downloadmeson-2fbc857ff4592b55acb8f4788d39c9f0fa0928dd.zip
meson-2fbc857ff4592b55acb8f4788d39c9f0fa0928dd.tar.gz
meson-2fbc857ff4592b55acb8f4788d39c9f0fa0928dd.tar.bz2
Better error message when using external libraries incorrectly. Closes #2447.
-rw-r--r--mesonbuild/build.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 9837d5a..2a71b8b 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -640,6 +640,12 @@ class BuildTarget(Target):
# in kwargs. Unpack here without looking at the exact type.
if hasattr(linktarget, "held_object"):
linktarget = linktarget.held_object
+ if isinstance(linktarget, dependencies.ExternalLibrary):
+ raise MesonException('''An external library was used in link_with keyword argument, which
+is reserved for libraries built as part of this project. External
+libraries must be passed using the dependencies keyword argument
+instead, because they are conceptually "external dependencies",
+just like those detected with the dependency() function.''')
self.link(linktarget)
lwhole = extract_as_list(kwargs, 'link_whole')
for linktarget in lwhole: