aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/mesonmain.py2
-rw-r--r--mesonbuild/optinterpreter.py9
2 files changed, 10 insertions, 1 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index f261935..f811def 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -28,7 +28,7 @@ default_warning = '1'
def add_builtin_argument(p, name, **kwargs):
k = kwargs.get('dest', name.replace('-', '_'))
c = coredata.get_builtin_option_choices(k)
- b = True if kwargs.get('action', None) in ['store_true', 'store_false'] else False
+ b = kwargs.get('action', None) in ['store_true', 'store_false']
h = coredata.get_builtin_option_description(k)
if not b:
h = h.rstrip('.') + ' (default: %s).' % coredata.get_builtin_option_default(k)
diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py
index f8ccbe6..df945ab 100644
--- a/mesonbuild/optinterpreter.py
+++ b/mesonbuild/optinterpreter.py
@@ -15,6 +15,7 @@
import os, re
import functools
+from . import mlog
from . import mparser
from . import coredata
from . import mesonlib
@@ -146,6 +147,14 @@ class OptionInterpreter:
e.colno = cur.colno
e.file = os.path.join('meson_options.txt')
raise e
+ bad = [o for o in sorted(self.cmd_line_options) if not
+ (o in list(self.options) + forbidden_option_names or
+ any(o.startswith(p) for p in forbidden_prefixes))]
+ if bad:
+ sub = 'In subproject {}: '.format(self.subproject) if self.subproject else ''
+ mlog.warning(
+ '{}Unknown command line options: "{}"\n'
+ 'This will become a hard error in a future Meson release.'.format(sub, ', '.join(bad)))
def reduce_single(self, arg):
if isinstance(arg, str):