From cb5ad2f2114519e4009f7ee6fcab3ad40d971de2 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 26 Apr 2018 21:49:00 -0400 Subject: Remove duplicated definition of -D cmdline arg --- mesonbuild/mconf.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'mesonbuild/mconf.py') 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() -- cgit v1.1 From 570c108635ca4b895330a6794061014c278886f8 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 26 Apr 2018 22:18:46 -0400 Subject: Fix --warnlevel being renamed to --warning-level in latest release --- mesonbuild/mconf.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'mesonbuild/mconf.py') diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index 48c0fe2..363b4a9 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py @@ -27,19 +27,6 @@ def buildparser(): return parser -def filter_builtin_options(args, original_args): - """Filter out any args passed with -- instead of -D.""" - for arg in 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.projectoptions]): - raise mesonlib.MesonException( - 'Got argument {0} as both -D{0} and --{0}. Pick one.'.format(name)) - args.projectoptions.append('{}={}'.format(name, getattr(args, name))) - delattr(args, name) - - class ConfException(mesonlib.MesonException): pass @@ -241,7 +228,7 @@ def run(args): if not args: args = [os.getcwd()] options = buildparser().parse_args(args) - filter_builtin_options(options, args) + coredata.filter_builtin_options(options, args) if len(options.directory) > 1: print('%s ' % args[0]) print('If you omit the build directory, the current directory is substituted.') -- cgit v1.1