Browse Source

fixes: error return value on empty dirs

IOS-2882
Andreas Buff 10 months ago
parent
commit
aafa5cc892
3 changed files with 18 additions and 10 deletions
  1. +8
    -4
      build-fat-bins.sh
  2. +8
    -4
      build-fat-libs.sh
  3. +2
    -2
      build-macos_dependency.template

+ 8
- 4
build-fat-bins.sh View File

@ -24,9 +24,6 @@ pushd "${OUTPUT_DIR}"
OUTPUT_DIR=$(pwd)
popd
echo "BUFF: ARCH1_DIR: ${ARCH1_DIR}"
echo "BUFF: ARCH1_DIR: ${ARCH2_DIR}"
exitAndPrintHelp()
{
echo "Must be called with ARCH1_DIR ARCH2_DIR OUTPUT_DIR, all absolute paths."
@ -41,8 +38,15 @@ elif [ "${OUTPUT_DIR}" = "" ]; then
exitAndPrintHelp
fi
echo "##############################################"
echo "# building fat binaries from ${ARCH1_DIR}"
echo "##############################################"
pushd "${ARCH1_DIR}"
BIN_FILE_NAMES=$(ls)
if [ "$(ls 2>/dev/null || :)" = "" ]; then
exit 0
fi
BIN_FILE_NAMES=$(ls 2>/dev/null)
popd
for BIN_FILE_NAME in ${BIN_FILE_NAMES}; do


+ 8
- 4
build-fat-libs.sh View File

@ -24,9 +24,6 @@ pushd "${OUTPUT_DIR}"
OUTPUT_DIR=$(pwd)
popd
echo "BUFF: ARCH1_DIR: ${ARCH1_DIR}"
echo "BUFF: ARCH1_DIR: ${ARCH2_DIR}"
exitAndPrintHelp()
{
echo "Must be called with ARCH1_DIR ARCH2_DIR OUTPUT_DIR, all absolute paths."
@ -41,8 +38,15 @@ elif [ "${OUTPUT_DIR}" = "" ]; then
exitAndPrintHelp
fi
echo "##############################################"
echo "# building fat libs from ${ARCH1_DIR}"
echo "##############################################"
pushd "${ARCH1_DIR}"
OBJECT_FILE_NAMES=$(ls *.a)
if [ "$(ls 2>/dev/null || :)" = "" ]; then
exit 0
fi
OBJECT_FILE_NAMES=$(ls *.a 2>/dev/null)
popd
for OBJECT_FILE_NAME in ${OBJECT_FILE_NAMES}; do


+ 2
- 2
build-macos_dependency.template View File

@ -90,9 +90,9 @@ sh "${SCRIPT_DIR}/build-fat-libs.sh" "${TMP_DIR}/arm64/lib" "${TMP_DIR}/x86_64/l
sh "${SCRIPT_DIR}/build-fat-bins.sh" "${TMP_DIR}/arm64/bin" "${TMP_DIR}/x86_64/bin" "${BIN_DIR}"
# Copy Headers
# Copy Headers If Currently Building Lib
ARM64_INCLUDE_DIR="${TMP_DIR}/arm64/include"
cp -r "${ARM64_INCLUDE_DIR}"/* "${INCLUDE_DIR}"
cp -r "${ARM64_INCLUDE_DIR}"/* "${INCLUDE_DIR}" 2>/dev/null || :
# Cleanup
cleanup

Loading…
Cancel
Save