aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/optinterpreter.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-12-22 19:41:56 +0200
committerGitHub <noreply@github.com>2017-12-22 19:41:56 +0200
commita50106afeecaa0d6bb3effd5baf08f37a3102511 (patch)
tree47a5912feb3cf3b8f0ed36d5eb301cfec7411a85 /mesonbuild/optinterpreter.py
parentb437977a608038cf754aba41346efa390411302e (diff)
parente245e578656f1b3876d22cae6253b58872b10463 (diff)
downloadmeson-a50106afeecaa0d6bb3effd5baf08f37a3102511.zip
meson-a50106afeecaa0d6bb3effd5baf08f37a3102511.tar.gz
meson-a50106afeecaa0d6bb3effd5baf08f37a3102511.tar.bz2
Merge pull request #2636 from dcbaker/submit/no-unknown-arguments
Don't accept unknown command line arguments
Diffstat (limited to 'mesonbuild/optinterpreter.py')
-rw-r--r--mesonbuild/optinterpreter.py9
1 files changed, 9 insertions, 0 deletions
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):