Merge pull request #1368 from dimkr/subproject_defaults

Bug fix - KeyError on subproject without default options
pull/1391/head
Jussi Pakkanen 8 years ago committed by GitHub
commit 87632fa51e
  1. 1
      authors.txt
  2. 5
      mesonbuild/interpreter.py
  3. 3
      test cases/common/95 dep fallback/meson.build

@ -62,3 +62,4 @@ Matthieu Gautier
Kseniia Vasilchuk
Philipp Geier
Mike Sinkovsky
Dima Krasner

@ -1576,9 +1576,10 @@ class Interpreter(InterpreterBase):
@stringArgs
def func_project(self, node, args, kwargs):
if self.environment.first_invocation and ('default_options' in kwargs or
default_options = kwargs.get('default_options', [])
if self.environment.first_invocation and (len(default_options) > 0 or
len(self.default_project_options) > 0):
self.parse_default_options(kwargs['default_options'])
self.parse_default_options(default_options)
if not self.is_subproject():
self.build.project_name = args[0]
if os.path.exists(self.option_file):

@ -1,6 +1,7 @@
project('dep fallback', 'c')
bob = dependency('boblib', fallback : ['boblib', 'bob_dep'], required: false)
bob = dependency('boblib', fallback : ['boblib', 'bob_dep'], required: false,
default_options : 'warning_level=1')
if not bob.found()
error('Bob is actually needed')
endif

Loading…
Cancel
Save