Allow extra make args to ./build-qemu -- arg0 arg1

configure args are now ./build-qemu --extra-config-args '"aa a" bb'

Also factor out arg names with other builds through _add_argument.

Fix #113.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2020-03-06 00:00:02 +00:00
parent d934dccecb
commit d1be4b2386
5 changed files with 30 additions and 35 deletions

View File

@@ -1613,33 +1613,46 @@ class BuildCliFunction(LkmcCliFunction):
'default': '',
'help': '''\
Pass the given compiler flags to all languages (C, C++, Fortran, etc.)
''',
},
'--configure': {
'default': True,
'help': '''\
Also run the configuration step during build.
''',
},
'--force-rebuild': {
'default': False,
"help": '''\
Force rebuild even if sources didn't change.
''',
},
'--configure': {
'default': True,
"help": '''\
Also run the configuration step during build.
''',
},
'--optimization-level': {
'default': '0',
'help': '''
'help': '''\
Use the given GCC -O optimization level.
For some scripts, there are hard technical challenges why it cannot
be implemented, e.g.: https://cirosantilli.com/linux-kernel-module-cheat#kernel-o0
and for others such as gem5 have their custom mechanism:
https://cirosantilli.com/linux-kernel-module-cheat#gem5-debug-build
''',
}
},
'extra_make_args': {
'default': [],
'help': '''\
Extra arguments to pass to the Make command or analogous final build command,
after configure, e.g. SCons. Usually contains specific targets or other build flags.
''',
'metavar': 'extra-make-args',
'nargs': '*',
},
}
def _add_argument(self, argument_name):
'''
Enable build argument with a fixed name to provide an uniform CLI API
across different builds.
'''
self.add_argument(
argument_name,
**self._build_arguments[argument_name]