aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-11-02 21:03:32 -0400
committerDylan Baker <dylan@pnwbakers.com>2021-11-02 19:56:10 -0700
commit1104b82137da55ecb4f13348bbb020d64e4fc78b (patch)
tree29fd9b7fddbd52d6639e5a543f4d245d27c4121f
parentd23ae8b58e73665d6418137446b259a2666af345 (diff)
downloadmeson-1104b82137da55ecb4f13348bbb020d64e4fc78b.zip
meson-1104b82137da55ecb4f13348bbb020d64e4fc78b.tar.gz
meson-1104b82137da55ecb4f13348bbb020d64e4fc78b.tar.bz2
fix custom_target with install: true and no install_dir, crashing
It's supposed to emit an error message, but instead it did a traceback. It used to be, if no install_dir was specified then it was simply not in kwargs, but due to typed_kwargs it will now be there, but not have viable contents, so the dict membership check got skipped. Fixes #9522
-rw-r--r--mesonbuild/build.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 6200235..0d606e6 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -2457,7 +2457,7 @@ class CustomTarget(Target, CommandBase):
if not isinstance(self.install, bool):
raise InvalidArguments('"install" must be boolean.')
if self.install:
- if 'install_dir' not in kwargs:
+ if not kwargs.get('install_dir', False):
raise InvalidArguments('"install_dir" must be specified '
'when installing a target')