aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-12-06 22:52:29 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2016-12-06 20:27:33 +0200
commitc7a2664cb7043160d653718179de97d4c7976e34 (patch)
tree7af0eaaa6a75bd148c45bb24e0b6cee3fb9a0d20 /mesonbuild/backend
parentc9818c02ecd9750eb9fd95ce510a31eb1d99e1f7 (diff)
downloadmeson-c7a2664cb7043160d653718179de97d4c7976e34.zip
meson-c7a2664cb7043160d653718179de97d4c7976e34.tar.gz
meson-c7a2664cb7043160d653718179de97d4c7976e34.tar.bz2
Better error when passing invalid objects to install_header
This will print the object type when you pass a generated file to install_header instead of printing an assert.
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/ninjabackend.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 71797ed..cc0167d 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -663,7 +663,9 @@ int dummy;
if outdir is None:
outdir = os.path.join(incroot, h.get_install_subdir())
for f in h.get_sources():
- assert(isinstance(f, File))
+ if not isinstance(f, File):
+ msg = 'Invalid header type {!r} can\'t be installed'
+ raise MesonException(msg.format(f))
abspath = f.absolute_path(srcdir, builddir)
i = [abspath, outdir]
d.headers.append(i)