Chromium Code Reviews| Index: build/toolchain/mac/linker_driver.py |
| diff --git a/build/toolchain/mac/linker_driver.py b/build/toolchain/mac/linker_driver.py |
| index 50ba540c34b877ebd9f74e398013cd47ddf190cc..88f04e0423a58b72a269c1f5a4615e3fcc3dc824 100755 |
| --- a/build/toolchain/mac/linker_driver.py |
| +++ b/build/toolchain/mac/linker_driver.py |
| @@ -158,7 +158,15 @@ def _FindLinkerOutput(full_args): |
| argument list. As this is a required linker argument, raises an error if it |
| cannot be found. |
| """ |
| - return full_args[full_args.index('-o') + 1] |
| + # The linker_driver.py script may be used to wrap either the compiler linker |
| + # (uses -o to configure the output) or lipo (uses -output to configure the |
| + # output). Since wrapping the compiler linker is the most likely possibility |
| + # use try/except and fallback to checking for -output if -o is not found. |
| + try: |
| + output_flag_index = full_args.index('-o') |
| + except ValueError as _: |
|
Robert Sesek
2016/07/18 20:09:43
Don't need an |as _| here if you're just catching
sdefresne
2016/07/19 09:12:13
Done.
|
| + output_flag_index = full_args.index('-output') |
| + return full_args[output_flag_index + 1] |
| def _RemovePath(path): |