Skip to content

Commit 0ca06c2

Browse files
committed
Tackle remaining review feedback
1 parent 359d54b commit 0ca06c2

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

utils/build-script-impl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,32 +1282,32 @@ function cmake_config_opt() {
12821282
}
12831283

12841284
function copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain() {
1285-
local clang_dest_dir=$1
1285+
local clang_dest_dir="$1"
12861286

12871287
HOST_CXX_DIR=$(dirname "${HOST_CXX}")
12881288
HOST_LIB_CLANG_DIR="${HOST_CXX_DIR}/../lib/clang"
12891289
DEST_LIB_CLANG_DIR="${clang_dest_dir}/lib/clang"
12901290

1291-
if [[ -d "${HOST_LIB_CLANG_DIR}" ]] && [[ -d "${DEST_LIB_CLANG_DIR}" ]]; then
1292-
DEST_CXX_BUILTINS_VERSION=$(ls "${DEST_LIB_CLANG_DIR}" | awk '{print $0}')
1293-
DEST_BUILTINS_DIR="${clang_dest_dir}/lib/clang/$DEST_CXX_BUILTINS_VERSION/lib/darwin"
1294-
1295-
if [[ -d "${DEST_BUILTINS_DIR}" ]]; then
1296-
for HOST_CXX_BUILTINS_PATH in "${HOST_LIB_CLANG_DIR}"/*; do
1297-
HOST_CXX_BUILTINS_DIR="${HOST_CXX_BUILTINS_PATH}/lib/darwin"
1298-
echo "copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR}."
1299-
1300-
for OS in ios watchos tvos; do
1301-
LIB_NAME="libclang_rt.$OS.a"
1302-
HOST_LIB_PATH="$HOST_CXX_BUILTINS_DIR/$LIB_NAME"
1303-
if [[ -f "${HOST_LIB_PATH}" ]]; then
1304-
call cp "${HOST_LIB_PATH}" "${DEST_BUILTINS_DIR}/${LIB_NAME}"
1305-
elif [[ "${VERBOSE_BUILD}" ]]; then
1306-
echo "no file exists at ${HOST_LIB_PATH}"
1307-
fi
1308-
done
1291+
[ -d "${HOST_LIB_CLANG_DIR}" -a -d "${DEST_LIB_CLANG_DIR}" ] || return
1292+
1293+
DEST_CXX_BUILTINS_VERSION=$(ls -1 "${DEST_LIB_CLANG_DIR}")
1294+
DEST_BUILTINS_DIR="${clang_dest_dir}/lib/clang/${DEST_CXX_BUILTINS_VERSION}/lib/darwin"
1295+
1296+
if [[ -d "${DEST_BUILTINS_DIR}" ]]; then
1297+
for HOST_CXX_BUILTINS_PATH in "${HOST_LIB_CLANG_DIR}"/*; do
1298+
HOST_CXX_BUILTINS_DIR="${HOST_CXX_BUILTINS_PATH}/lib/darwin"
1299+
echo "copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR}."
1300+
1301+
for OS in ios watchos tvos; do
1302+
LIB_NAME="libclang_rt.$OS.a"
1303+
HOST_LIB_PATH="$HOST_CXX_BUILTINS_DIR/$LIB_NAME"
1304+
if [[ -f "${HOST_LIB_PATH}" ]]; then
1305+
call cp "${HOST_LIB_PATH}" "${DEST_BUILTINS_DIR}/${LIB_NAME}"
1306+
elif [[ "${VERBOSE_BUILD}" ]]; then
1307+
echo "no file exists at ${HOST_LIB_PATH}"
1308+
fi
13091309
done
1310-
fi
1310+
done
13111311
fi
13121312
}
13131313

0 commit comments

Comments
 (0)