From f31bf4636ac245c71ed88d5990c2b6d6484e37e8 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 5 Jan 2014 23:03:52 +0200 Subject: Can set core options. --- optinterpreter.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'optinterpreter.py') 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) -- cgit v1.2.3