Index: tools-webrtc/android/build_aar.py |
diff --git a/tools-webrtc/android/build_aar.py b/tools-webrtc/android/build_aar.py |
index 7f6937f2001fa54d2bcae0ea5fd7d61557fb6841..d58f9dd330b053e2b959a81ffdcb758282723a05 100755 |
--- a/tools-webrtc/android/build_aar.py |
+++ b/tools-webrtc/android/build_aar.py |
@@ -54,6 +54,8 @@ def _ParseArgs(): |
help='Use goma.') |
parser.add_argument('--verbose', action='store_true', default=False, |
help='Debug logging.') |
+ parser.add_argument('--extra-gn-args', action='append', default=[], |
sakal
2017/02/06 09:24:11
I would prefer this be a regular string parameter.
kjellander_webrtc
2017/02/06 14:44:12
Since I have action='append' it is possible to pas
sakal
2017/02/06 14:52:57
I find passing arguments one by one a little cumbe
|
+ help='Additional GN args to be used during Ninja generation.') |
return parser.parse_args() |
@@ -108,7 +110,7 @@ def _GetArmVersion(arch): |
raise Exception('Unknown arch: ' + arch) |
-def Build(tmp_dir, arch, use_goma): |
+def Build(tmp_dir, arch, use_goma, extra_gn_args): |
"""Generates target architecture using GN and builds it using ninja.""" |
logging.info('Building: %s', arch) |
output_directory = _GetOutputDirectory(tmp_dir, arch) |
@@ -123,7 +125,7 @@ def Build(tmp_dir, arch, use_goma): |
if arm_version: |
gn_args['arm_version'] = arm_version |
gn_args_str = '--args=' + ' '.join([ |
- k + '=' + _EncodeForGN(v) for k, v in gn_args.items()]) |
+ k + '=' + _EncodeForGN(v) for k, v in gn_args.items()] + extra_gn_args) |
sakal
2017/02/06 09:24:11
I would prefer a system where you can override exi
kjellander_webrtc
2017/02/06 14:44:12
argparse doesn't support dicts, so I think it's a
sakal
2017/02/06 14:52:57
Yeah, you would have to manually parse the list in
|
_RunGN(['gen', output_directory, gn_args_str]) |
@@ -162,7 +164,7 @@ def main(): |
tmp_dir = tempfile.mkdtemp() |
for arch in args.arch: |
- Build(tmp_dir, arch, args.use_goma) |
+ Build(tmp_dir, arch, args.use_goma, args.extra_gn_args) |
with zipfile.ZipFile(args.output, 'w') as aar_file: |
# Architecture doesn't matter here, arbitrarily using the first one. |