aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-01-05 18:35:08 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2017-01-06 14:00:00 -0500
commitfdd0675661ad5aac74ee449f14b4a17ca1bd44b5 (patch)
treecc27f0063f1e3c2b490144fe336af112402d85b3
parent56e2c46ce1cb1ffb4f0fe56c6462954dd00f33c4 (diff)
downloadmeson-fdd0675661ad5aac74ee449f14b4a17ca1bd44b5.zip
meson-fdd0675661ad5aac74ee449f14b4a17ca1bd44b5.tar.gz
meson-fdd0675661ad5aac74ee449f14b4a17ca1bd44b5.tar.bz2
Better error messages. Closes #1284.
-rw-r--r--mesonbuild/build.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index f895531..7d3a5c4 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -726,11 +726,14 @@ class BuildTarget():
elif isinstance(dep, dependencies.Dependency):
self.external_deps.append(dep)
self.process_sourcelist(dep.get_sources())
+ elif isinstance(dep, BuildTarget):
+ raise InvalidArguments('''Tried to use a build target as a dependency.
+You probably should put it in link_with instead.''')
else:
# This is a bit of a hack. We do not want Build to know anything
# about the interpreter so we can't import it and use isinstance.
# This should be reliable enough.
- if hasattr(dep, 'subproject'):
+ if hasattr(dep, 'args_frozen'):
raise InvalidArguments('Tried to use subproject object as a dependency.\n'
'You probably wanted to use a dependency declared in it instead.\n'
'Access it by calling get_variable() on the subproject object.')