aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-04-29 20:27:43 +0300
committerGitHub <noreply@github.com>2018-04-29 20:27:43 +0300
commitd52f892de96d40a4d4a8de278e861c911223a4c3 (patch)
treeb0e47078595708a10e6edb807fb4c506ff89a759 /mesonbuild/mesonmain.py
parent91e204e382d6fff654e4f7fae1daf6e02122a9b5 (diff)
parent6de68e520141f73088f8b8aaeb39abc59661da6d (diff)
downloadmeson-d52f892de96d40a4d4a8de278e861c911223a4c3.zip
meson-d52f892de96d40a4d4a8de278e861c911223a4c3.tar.gz
meson-d52f892de96d40a4d4a8de278e861c911223a4c3.tar.bz2
Merge pull request #3485 from xclaesse/warnlevel
--warnlevel got renamed to --warning-level
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index f4fec95..2b6281d 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -32,8 +32,6 @@ def create_parser():
coredata.register_builtin_arguments(p)
p.add_argument('--cross-file', default=None,
help='File describing cross compilation environment.')
- p.add_argument('-D', action='append', dest='projectoptions', default=[], metavar="option",
- help='Set the value of an option, can be used several times to set multiple options.')
p.add_argument('-v', '--version', action='version',
version=coredata.version)
# See the mesonlib.WrapMode enum for documentation
@@ -63,11 +61,12 @@ def filter_builtin_options(args, original_args):
if meson_opts:
for arg in meson_opts:
value = arguments[arg]
- if any([a.startswith('--{}'.format(arg)) for a in original_args]):
+ cmdline_name = coredata.get_builtin_option_cmdline_name(arg)
+ if any([a.startswith(cmdline_name) for a in original_args]):
raise MesonException(
- 'Argument "{0}" passed as both --{0} and -D{0}, but only '
- 'one is allowed'.format(arg))
- setattr(args, coredata.get_builtin_option_destination(arg), value)
+ 'Argument "{0}" passed as both {1} and -D{0}, but only '
+ 'one is allowed'.format(arg, cmdline_name))
+ setattr(args, arg, value)
# Remove the builtin option from the project args values
args.projectoptions.remove('{}={}'.format(arg, value))