aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-02-06 12:15:54 -0800
committerDylan Baker <dylan@pnwbakers.com>2018-04-17 11:32:26 -0700
commitcdefc152852cbed2a88dd6ea9ad71facb1fbe0e8 (patch)
treec37ea130ce8be7e8438ba5a354df19f07f3bca05 /mesonbuild/mesonmain.py
parent1452eb73c153923ce69876b0e223b26b849a35e1 (diff)
downloadmeson-cdefc152852cbed2a88dd6ea9ad71facb1fbe0e8.zip
meson-cdefc152852cbed2a88dd6ea9ad71facb1fbe0e8.tar.gz
meson-cdefc152852cbed2a88dd6ea9ad71facb1fbe0e8.tar.bz2
mesonmain: be DRY
We have all the information needed to calculate the builtin arguments in the coredata module already, don't duplicate that in the mesonmain module as well.
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py28
1 files changed, 4 insertions, 24 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 4b590a1..7b87843f 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -25,7 +25,8 @@ from .wrap import WrapMode, wraptool
default_warning = '1'
-def add_builtin_argument(p, name, **kwargs):
+def add_builtin_argument(p, name):
+ kwargs = {}
k = coredata.get_builtin_option_destination(name)
c = coredata.get_builtin_option_choices(k)
b = coredata.get_builtin_option_action(k)
@@ -45,29 +46,8 @@ def add_builtin_argument(p, name, **kwargs):
def create_parser():
p = argparse.ArgumentParser(prog='meson')
- add_builtin_argument(p, 'prefix')
- add_builtin_argument(p, 'libdir')
- add_builtin_argument(p, 'libexecdir')
- add_builtin_argument(p, 'bindir')
- add_builtin_argument(p, 'sbindir')
- add_builtin_argument(p, 'includedir')
- add_builtin_argument(p, 'datadir')
- add_builtin_argument(p, 'mandir')
- add_builtin_argument(p, 'infodir')
- add_builtin_argument(p, 'localedir')
- add_builtin_argument(p, 'sysconfdir')
- add_builtin_argument(p, 'localstatedir')
- add_builtin_argument(p, 'sharedstatedir')
- add_builtin_argument(p, 'backend')
- add_builtin_argument(p, 'buildtype')
- add_builtin_argument(p, 'strip')
- add_builtin_argument(p, 'unity')
- add_builtin_argument(p, 'werror')
- add_builtin_argument(p, 'layout')
- add_builtin_argument(p, 'default-library')
- add_builtin_argument(p, 'warnlevel')
- add_builtin_argument(p, 'stdsplit')
- add_builtin_argument(p, 'errorlogs')
+ for n in coredata.builtin_options:
+ add_builtin_argument(p, n)
p.add_argument('--cross-file', default=None,
help='File describing cross compilation environment.')
p.add_argument('-D', action='append', dest='projectoptions', default=[], metavar="option",