|
|
|
@ -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() |
|
|
|
|