meta: replace cmake mono-build system with a custom build co-ordinator
every system component now has its own self-contained build system, and a seed file describing the component and its build system and dependencies. a new tool, meadow, collects and uses these seed files to build the components into a full system. meadow also manages the target system root and a host prefix where toolchain tools are installed to. the build system has also been updated to use a new $ARCH-rosetta-gcc compiler, and the patches files necessary to build it have been added to toolchain/cross-compiler.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
class Args:
|
||||
def __init__(self, argv):
|
||||
self.__argv = argv
|
||||
|
||||
|
||||
def get_positional(self, index):
|
||||
if len(self.__argv) > index:
|
||||
return self.__argv[index]
|
||||
return None
|
||||
|
||||
|
||||
def get_named(self, name, index, nr_args):
|
||||
found_name = False
|
||||
values = []
|
||||
|
||||
for s in self.__argv:
|
||||
if found_name:
|
||||
if nr_args > 0:
|
||||
nr_args -= 1
|
||||
values.append(s)
|
||||
continue
|
||||
else:
|
||||
break
|
||||
|
||||
if s == '--{}'.format(name):
|
||||
if index > 0:
|
||||
index -= 1
|
||||
continue
|
||||
|
||||
found_name = True
|
||||
continue
|
||||
|
||||
if nr_args == 0:
|
||||
return found_name
|
||||
|
||||
if nr_args > 0 or not found_name:
|
||||
return None
|
||||
|
||||
if len(values) == 1:
|
||||
return values[0]
|
||||
|
||||
return values
|
||||
Reference in New Issue
Block a user