diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-02-09 23:02:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-09 23:02:47 +0200 |
commit | 87632fa51e946a3b7aa429aa28aff3a074953d7c (patch) | |
tree | 5c17a61dbc8d82729181cff92999c82fa8f79865 | |
parent | 00251f16b61c97ca660b6bf91e59976cde478b40 (diff) | |
parent | a306a1f676936c6e7270e310e00472757492b9e3 (diff) | |
download | meson-87632fa51e946a3b7aa429aa28aff3a074953d7c.zip meson-87632fa51e946a3b7aa429aa28aff3a074953d7c.tar.gz meson-87632fa51e946a3b7aa429aa28aff3a074953d7c.tar.bz2 |
Merge pull request #1368 from dimkr/subproject_defaults
Bug fix - KeyError on subproject without default options
-rw-r--r-- | authors.txt | 1 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 5 | ||||
-rw-r--r-- | test cases/common/95 dep fallback/meson.build | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/authors.txt b/authors.txt index 72606e9..2f36256 100644 --- a/authors.txt +++ b/authors.txt @@ -62,3 +62,4 @@ Matthieu Gautier Kseniia Vasilchuk Philipp Geier Mike Sinkovsky +Dima Krasner diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 007a7d5..4466f22 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -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): diff --git a/test cases/common/95 dep fallback/meson.build b/test cases/common/95 dep fallback/meson.build index 212c64f..9358d29 100644 --- a/test cases/common/95 dep fallback/meson.build +++ b/test cases/common/95 dep fallback/meson.build @@ -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 |