| Index: build/toolchain/gcc_ar_wrapper.py
|
| diff --git a/build/toolchain/gcc_ar_wrapper.py b/build/toolchain/gcc_ar_wrapper.py
|
| index a8f319030761342125f5b0e0c775e1a8611ea4f4..de53df09e97582ab424b38c966beff262e8fd849 100755
|
| --- a/build/toolchain/gcc_ar_wrapper.py
|
| +++ b/build/toolchain/gcc_ar_wrapper.py
|
| @@ -16,20 +16,7 @@ import os
|
| import subprocess
|
| import sys
|
|
|
| -
|
| -# When running on a Windows host and using a toolchain whose tools are
|
| -# actually wrapper scripts (i.e. .bat files on Windows) rather than binary
|
| -# executables, the "command" to run has to be prefixed with this magic.
|
| -# The GN toolchain definitions take care of that for when GN/Ninja is
|
| -# running the tool directly. When that command is passed in to this
|
| -# script, it appears as a unitary string but needs to be split up so that
|
| -# just 'cmd' is the actual command given to Python's subprocess module.
|
| -BAT_PREFIX = 'cmd /c call '
|
| -
|
| -def CommandToRun(command):
|
| - if command[0].startswith(BAT_PREFIX):
|
| - command = command[0].split(None, 3) + command[1:]
|
| - return command
|
| +import wrapper_utils
|
|
|
|
|
| def main():
|
| @@ -44,12 +31,20 @@ def main():
|
| metavar='ARCHIVE')
|
| parser.add_argument('--plugin',
|
| help='Load plugin')
|
| + parser.add_argument('--resource-whitelist',
|
| + help='Merge all resource whitelists into a single file.',
|
| + metavar='PATH')
|
| parser.add_argument('operation',
|
| help='Operation on the archive')
|
| parser.add_argument('inputs', nargs='+',
|
| help='Input files')
|
| args = parser.parse_args()
|
|
|
| + if args.resource_whitelist:
|
| + whitelist_candidates = wrapper_utils.ResolveRspLinks(args.inputs)
|
| + wrapper_utils.CombineResourceWhitelists(
|
| + whitelist_candidates, args.resource_whitelist)
|
| +
|
| command = [args.ar, args.operation]
|
| if args.plugin is not None:
|
| command += ['--plugin', args.plugin]
|
| @@ -64,7 +59,7 @@ def main():
|
| raise
|
|
|
| # Now just run the ar command.
|
| - return subprocess.call(CommandToRun(command))
|
| + return subprocess.call(wrapper_utils.CommandToRun(command))
|
|
|
|
|
| if __name__ == "__main__":
|
|
|