Skip to content

Commit cb25560

Browse files
authored
[build-script] Allow lipo of cross-compiled lldb products (#27920)
Teach build-script to build lldb's `install-distribution` target when installation is required, and make the lipo action invoke lipo when cross-compiling. Incidentally this fixes a bash warning about `continue` being invalid outside of a loop.
1 parent 398cb58 commit cb25560

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

utils/build-script-impl

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3055,6 +3055,16 @@ done
30553055
LIPO_SRC_DIRS=()
30563056

30573057
for host in "${ALL_HOSTS[@]}"; do
3058+
# Calculate the directory to install products in to.
3059+
host_install_destdir=$(get_host_install_destdir ${host})
3060+
host_install_prefix=$(get_host_install_prefix ${host})
3061+
3062+
# Identify the destdirs to pass to lipo. Must happen even if the install action
3063+
# is to be skipped.
3064+
if [[ $(should_include_host_in_lipo ${host}) ]]; then
3065+
LIPO_SRC_DIRS+=( "${host_install_destdir}" )
3066+
fi
3067+
30583068
# Skip this pass when the only action to execute can't match.
30593069
if ! [[ $(should_execute_host_actions_for_phase ${host} install) ]]; then
30603070
continue
@@ -3065,14 +3075,6 @@ for host in "${ALL_HOSTS[@]}"; do
30653075
continue
30663076
fi
30673077

3068-
# Calculate the directory to install products in to.
3069-
host_install_destdir=$(get_host_install_destdir ${host})
3070-
host_install_prefix=$(get_host_install_prefix ${host})
3071-
3072-
if [[ $(should_include_host_in_lipo ${host}) ]]; then
3073-
LIPO_SRC_DIRS+=( "${host_install_destdir}" )
3074-
fi
3075-
30763078
# Set the build options for this host
30773079
set_build_options_for_host $host
30783080

@@ -3131,6 +3133,7 @@ for host in "${ALL_HOSTS[@]}"; do
31313133
echo "--install-destdir is required to install products."
31323134
exit 1
31333135
fi
3136+
INSTALL_TARGETS="install-distribution"
31343137
;;
31353138
xctest)
31363139
if [[ -z "${INSTALL_XCTEST}" ]] ; then
@@ -3479,15 +3482,10 @@ for host in "${ALL_HOSTS[@]}"; do
34793482
done
34803483

34813484
# Lipo those products which require it, optionally build and test an installable package.
3482-
if [[ ${#LIPO_SRC_DIRS[@]} -gt 0 ]]; then
3485+
mergedHost="merged-hosts"
3486+
if [[ ${#LIPO_SRC_DIRS[@]} -gt 0 ]] && [[ $(should_execute_action "${mergedHost}-lipo") ]]; then
34833487
# This is from multiple hosts; Which host should we say it is?
34843488
# Let's call it 'merged-hosts' so that we can identify it.
3485-
mergedHost="merged-hosts"
3486-
3487-
# Check if we should perform this action.
3488-
if ! [[ $(should_execute_action "${mergedHost}-lipo") ]]; then
3489-
continue
3490-
fi
34913489

34923490
echo "--- Merging and running lipo ---"
34933491

0 commit comments

Comments
 (0)