aboutsummaryrefslogtreecommitdiff
path: root/mesonlib.py
diff options
context:
space:
mode:
authorYoav Alon <yoaval@checkpoint.com>2015-11-28 01:40:54 +0200
committerYoav Alon <yoaval@checkpoint.com>2015-11-28 21:26:56 +0200
commita4809cf63291b3fa2eeb48a82094ca75d9a64113 (patch)
tree335c0f23d6a961fd4b04940ca9c7666b70c87b13 /mesonlib.py
parent33301dec0e068d0bfdc579aff2b40d2018402b4c (diff)
downloadmeson-a4809cf63291b3fa2eeb48a82094ca75d9a64113.zip
meson-a4809cf63291b3fa2eeb48a82094ca75d9a64113.tar.gz
meson-a4809cf63291b3fa2eeb48a82094ca75d9a64113.tar.bz2
Added support for extended command line to overcome OS command line length limitation
Diffstat (limited to 'mesonlib.py')
-rw-r--r--mesonlib.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/mesonlib.py b/mesonlib.py
index bb69632..99d6154 100644
--- a/mesonlib.py
+++ b/mesonlib.py
@@ -264,3 +264,21 @@ def stringlistify(item):
if not isinstance(i, str):
raise MesonException('List item not a string.')
return item
+
+def expand_arguments(args):
+ expended_args = []
+ for arg in args:
+ if not arg.startswith('@'):
+ expended_args.append(arg)
+ continue
+
+ args_file = arg[1:]
+ try:
+ with open(args_file) as f:
+ extended_args = f.read().split()
+ expended_args += extended_args
+ except Exception as e:
+ print('Error expanding command line arguments, %s not found' % args_file)
+ print(e)
+ return None
+ return expended_args