diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2014-01-05 23:03:52 +0200 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2014-01-05 23:03:52 +0200 |
| commit | f31bf4636ac245c71ed88d5990c2b6d6484e37e8 (patch) | |
| tree | 9010ced34bb0e98554f5af4df0660f6b59009073 /optinterpreter.py | |
| parent | 671141fb369435202352652876662946849eab89 (diff) | |
| download | meson-f31bf4636ac245c71ed88d5990c2b6d6484e37e8.tar.gz | |
Can set core options.
Diffstat (limited to 'optinterpreter.py')
| -rw-r--r-- | optinterpreter.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/optinterpreter.py b/optinterpreter.py index 756ec5f87..8d42e1f8b 100644 --- a/optinterpreter.py +++ b/optinterpreter.py @@ -1,4 +1,4 @@ -# Copyright 2013 Jussi Pakkanen +# Copyright 2013-2014 Jussi Pakkanen # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,6 +17,13 @@ import coredata import nodes import os +forbidden_option_names = {'type': True, + 'strip': True, + 'coverage': True, + 'pch': True, + 'unity': True, + } + class OptionException(coredata.MesonException): pass @@ -138,6 +145,8 @@ class OptionInterpreter: opt_name = posargs[0] if not isinstance(opt_name, str): raise OptionException('Positional argument must be a string.') + if opt_name in forbidden_option_names: + raise OptionException('Option name %s is reserved.' % opt_name) if self.subproject != '': opt_name = self.subproject + '-' + opt_name opt = option_types[opt_type](kwargs) |
