CustomTarget: require install_dir only when install is true (#519)

pull/521/head
Nirbheek Chauhan 9 years ago committed by Jussi Pakkanen
parent 8cd359acbb
commit 35ef1d109a
  1. 11
      mesonbuild/build.py

@ -871,11 +871,12 @@ class CustomTarget:
self.install = kwargs['install'] self.install = kwargs['install']
if not isinstance(self.install, bool): if not isinstance(self.install, bool):
raise InvalidArguments('"install" must be boolean.') raise InvalidArguments('"install" must be boolean.')
if 'install_dir' not in kwargs: if self.install:
raise InvalidArguments('"install_dir" not specified.') if 'install_dir' not in kwargs:
self.install_dir = kwargs['install_dir'] raise InvalidArguments('"install_dir" not specified.')
if not(isinstance(self.install_dir, str)): self.install_dir = kwargs['install_dir']
raise InvalidArguments('"install_dir" must be a string.') if not(isinstance(self.install_dir, str)):
raise InvalidArguments('"install_dir" must be a string.')
else: else:
self.install = False self.install = False
self.build_always = kwargs.get('build_always', False) self.build_always = kwargs.get('build_always', False)

Loading…
Cancel
Save