Skip to content

Commit

Permalink
Build: Mac: Fix universal build to contain both archs
Browse files Browse the repository at this point in the history
One of the last-minute changes broke the universal build and resulted in
a universal build which only contained a single architecture.
The reason was that the added `distclean` action removed the artifact
for the first architecture.

This change moves the intermediate artifacts to a temporary, already
defined  directory which is definitely not touched by `make distclean`.

Related: jamulussoftware#2808 (comment)
Related: jamulussoftware#2808 (comment)
  • Loading branch information
hoffie committed Aug 29, 2022
1 parent 6f10b98 commit 04fdee2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mac/deploy_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ build_app() {
make -f "${build_path}/Makefile" -C "${build_path}" -j "${job_count}"
target_name=$(sed -nE 's/^QMAKE_TARGET *= *(.*)$/\1/p' "${build_path}/Makefile")
if [[ ${#target_archs_array[@]} -gt 1 ]]; then
# When building for multiple architectures, move the binary to a safe place to avoid overwriting by the other passes.
mv "${build_path}/${target_name}.app/Contents/MacOS/${target_name}" "${build_path}/${target_name}.app/Contents/MacOS/${target_name}.arch_${target_arch}"
# When building for multiple architectures, move the binary to a safe place to avoid overwriting/cleaning by the other passes.
mv "${build_path}/${target_name}.app/Contents/MacOS/${target_name}" "${deploy_path}/${target_name}.arch_${target_arch}"
fi
done
if [[ ${#target_archs_array[@]} -gt 1 ]]; then
echo "Building universal binary from: " "${build_path}/${target_name}.app/Contents/MacOS/${target_name}.arch_"*
lipo -create -output "${build_path}/${target_name}.app/Contents/MacOS/${target_name}" "${build_path}/${target_name}.app/Contents/MacOS/${target_name}.arch_"*
rm -f "${build_path}/${target_name}.app/Contents/MacOS/${target_name}.arch_"*
echo "Building universal binary from: " "${deploy_path}/${target_name}.arch_"*
lipo -create -output "${build_path}/${target_name}.app/Contents/MacOS/${target_name}" "${deploy_path}/${target_name}.arch_"*
rm -f "${deploy_path}/${target_name}.arch_"*
file "${build_path}/${target_name}.app/Contents/MacOS/${target_name}"
fi

Expand Down

0 comments on commit 04fdee2

Please sign in to comment.