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
This commit is contained in:
Chris Bracken 2017-02-17 13:38:47 -08:00 committed by GitHub
parent 0962dd6a94
commit 36e3260bfe

View File

@ -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