Commit b16a515d authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Handle non-fat frameworks in iOS app framework thinning (#7950)

Support for thinning app frameworks to the target architecture was added
in 708909fc. This commit adds support
and error-checking for non-fat frameworks that are not of the target
architecture. In such cases, we now fail the build, and emit an error
message and the contents of lipo -info for the affected framework.
parent 2eb4f2c3
......@@ -141,13 +141,22 @@ LipoExecutable() {
local all_executables=()
for arch in $archs; do
local output="${executable}_${arch}"
lipo -output "${output}" -extract "${arch}" "${executable}"
if [[ $? == 0 ]]; then
all_executables+=("${output}")
local lipo_info=$(lipo -info "${executable}")
if [[ "${lipo_info}" == "Non-fat file:"* ]]; then
if [[ "${lipo_info}" != *"${arch}" ]]; then
echo "Non-fat binary ${executable} is not ${arch}. Running lipo -info:"
echo "${lipo_info}"
exit 1
fi
else
echo "Failed to extract ${arch} for ${executable}. Running lipo -info:"
lipo -info "${executable}"
exit 1
lipo -output "${output}" -extract "${arch}" "${executable}"
if [[ $? == 0 ]]; then
all_executables+=("${output}")
else
echo "Failed to extract ${arch} for ${executable}. Running lipo -info:"
lipo -info "${executable}"
exit 1
fi
fi
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment