diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2018-04-26 21:49:00 -0400 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2018-04-26 22:46:40 -0400 |
commit | cb5ad2f2114519e4009f7ee6fcab3ad40d971de2 (patch) | |
tree | cf2bb943b27e0f6b32e78430b24b30bde70d3dd2 /mesonbuild/mconf.py | |
parent | 3ad45ef94e3372b81b284d7edd21123376f63575 (diff) | |
download | meson-cb5ad2f2114519e4009f7ee6fcab3ad40d971de2.zip meson-cb5ad2f2114519e4009f7ee6fcab3ad40d971de2.tar.gz meson-cb5ad2f2114519e4009f7ee6fcab3ad40d971de2.tar.bz2 |
Remove duplicated definition of -D cmdline arg
Diffstat (limited to 'mesonbuild/mconf.py')
-rw-r--r-- | mesonbuild/mconf.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index fd4c141..48c0fe2 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py @@ -21,8 +21,6 @@ def buildparser(): parser = argparse.ArgumentParser(prog='meson configure') coredata.register_builtin_arguments(parser) - parser.add_argument('-D', action='append', default=[], dest='sets', - help='Set an option to the given value.') parser.add_argument('directory', nargs='*') parser.add_argument('--clearcache', action='store_true', default=False, help='Clear cached state (e.g. found dependencies)') @@ -35,10 +33,10 @@ def filter_builtin_options(args, original_args): if not arg.startswith('--') or arg == '--clearcache': continue name = arg.lstrip('--').split('=', 1)[0] - if any([a.startswith(name + '=') for a in args.sets]): + if any([a.startswith(name + '=') for a in args.projectoptions]): raise mesonlib.MesonException( 'Got argument {0} as both -D{0} and --{0}. Pick one.'.format(name)) - args.sets.append('{}={}'.format(name, getattr(args, name))) + args.projectoptions.append('{}={}'.format(name, getattr(args, name))) delattr(args, name) @@ -255,8 +253,8 @@ def run(args): try: c = Conf(builddir) save = False - if len(options.sets) > 0: - c.set_options(options.sets) + if len(options.projectoptions) > 0: + c.set_options(options.projectoptions) save = True elif options.clearcache: c.clear_cache() |