diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2016-09-07 21:25:34 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-09-07 21:25:34 +0300 |
commit | 165f8a913d25cd0cc35639811235f19e15ad08ec (patch) | |
tree | f9bdd007a1f873576f558a85e5f40b46f09b7fd5 /mesonbuild/build.py | |
parent | 69433025ca8523838dbe55d0c20ea28cbc51cc23 (diff) | |
download | meson-165f8a913d25cd0cc35639811235f19e15ad08ec.zip meson-165f8a913d25cd0cc35639811235f19e15ad08ec.tar.gz meson-165f8a913d25cd0cc35639811235f19e15ad08ec.tar.bz2 |
Better error message when trying to use subprojects as dependencies.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 4123195..50abd52 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -533,7 +533,14 @@ class BuildTarget(): self.external_deps.append(dep) self.process_sourcelist(dep.get_sources()) else: - raise InvalidArguments('Argument is not an external dependency') + # 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'): + raise InvalidArguments('''Tried to use subproject object as a dependency. +You probably wanted to use a dependency declared in it instead. Access it +by calling get_variable() on the subproject object.''') + raise InvalidArguments('Argument is not an external dependency.') def get_external_deps(self): return self.external_deps |