From 36e3260bfe04ffbf4cc46f5bb59eb58df0cf35ee Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 17 Feb 2017 13:38:47 -0800 Subject: [PATCH] Do not attempt to merge non-fat frameworks in Xcode build (#8251) * Do not attempt to merge non-fat frameworks in Xcode build During the Xcode build, we strip code irrelevant to the target architecture in frameworks used by the application. In the case of non-fat executables, no stripping occurs, so the frameworks can be used as-is. No merge & replace step is necessary. * fixup! Do not attempt to merge non-fat frameworks in Xcode build --- packages/flutter_tools/bin/xcode_backend.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/flutter_tools/bin/xcode_backend.sh b/packages/flutter_tools/bin/xcode_backend.sh index 630a7dc0ae5..22e96d1d805 100755 --- a/packages/flutter_tools/bin/xcode_backend.sh +++ b/packages/flutter_tools/bin/xcode_backend.sh @@ -163,13 +163,15 @@ LipoExecutable() { fi done - # Merge desired architectures. - local merged="${executable}_merged" - lipo -output "${merged}" -create "${all_executables[@]}" + # Generate a merged binary from the architecture-specific executables. + # Skip this step for non-fat executables. + if [[ ${#all_executables[@]} > 0 ]]; then + local merged="${executable}_merged" + lipo -output "${merged}" -create "${all_executables[@]}" - # Replace the original executable with the thinned one and clean up. - cp -f -- "${merged}" "${executable}" > /dev/null - rm -f -- "${merged}" "${all_executables[@]}" + cp -f -- "${merged}" "${executable}" > /dev/null + rm -f -- "${merged}" "${all_executables[@]}" + fi } # Destructively thins the specified framework to include only the specified