Unify library building logs

This commit is contained in:
Stan 2024-12-15 10:23:23 +01:00
parent 7b195d6a5d
commit d15f1c29e4
No known key found for this signature in database
GPG key ID: 244943DFF8370D60
8 changed files with 126 additions and 44 deletions

View file

@ -154,11 +154,19 @@ fi
# Parse command-line options:
force_rebuild=false
for i in "$@"; do
case $i in
--force-rebuild) force_rebuild=true ;;
-j*) JOBS=$i ;;
while [ "$#" -gt 0 ]; do
case "$1" in
--force-rebuild)
force_rebuild=true
build_sh_options="$build_sh_options --force-rebuild"
;;
-j*) JOBS="$1" ;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done
cd "$(dirname "$0")" # Now in libraries/ (where we assume this script resides)
@ -172,6 +180,7 @@ if [ $force_rebuild = "true" ]; then
fi
mkdir -p "$PC_PATH"
echo "Building third-party dependencies..."
# --------------------------------------------------------------
echo "Building zlib..."
@ -393,7 +402,7 @@ echo "Building SDL2..."
--without-x \
--enable-video-cocoa \
--enable-shared=no || die
make "$JOBS" || die
make "${JOBS}" || die
make install || die
) || die "SDL2 build failed"
@ -1134,26 +1143,21 @@ echo "Building Molten VK..."
export ARCH CXXFLAGS CFLAGS LDFLAGS CMAKE_FLAGS JOBS
# --------------------------------------------------------------
echo "Building cxxtest..."
./../source/cxxtest-4.4/build.sh || die "cxxtest build failed"
# shellcheck disable=SC2086
./../source/cxxtest-4.4/build.sh $build_sh_options || die "cxxtest build failed"
# --------------------------------------------------------------
echo "Building FCollada..."
./../source/fcollada/build.sh || die "FCollada build failed"
# shellcheck disable=SC2086
./../source/fcollada/build.sh $build_sh_options || die "FCollada build failed"
# --------------------------------------------------------------
echo "Building nvtt..."
./../source/nvtt/build.sh || die "NVTT build failed"
# shellcheck disable=SC2086
./../source/nvtt/build.sh $build_sh_options || die "NVTT build failed"
# --------------------------------------------------------------
echo "Building Premake..."
./../source/premake-core/build.sh || die "Premake build failed"
# shellcheck disable=SC2086
./../source/premake-core/build.sh $build_sh_options || die "Premake build failed"
# --------------------------------------------------------------
echo "Building Spidermonkey..."
./../source/spidermonkey/build.sh || die "SpiderMonkey build failed"
# shellcheck disable=SC2086
./../source/spidermonkey/build.sh $build_sh_options || die "SpiderMonkey build failed"

View file

@ -30,16 +30,22 @@ with_spirv_reflect=false
JOBS=${JOBS:="-j2"}
for i in "$@"; do
case $i in
while [ "$#" -gt 0 ]; do
case "$1" in
--force-rebuild) build_sh_options="$build_sh_options --force-rebuild" ;;
--without-nvtt) without_nvtt=true ;;
--with-system-cxxtest) with_system_cxxtest=true ;;
--with-system-nvtt) with_system_nvtt=true ;;
--with-system-mozjs) with_system_mozjs=true ;;
--with-system-premake) with_system_mozjs=true ;;
--with-spirv-reflect) with_spirv_reflect=true ;;
-j*) JOBS=$i ;;
-j*) JOBS="$1" ;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done
# Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE
@ -57,30 +63,30 @@ export MAKE JOBS
# Build/update bundled external libraries
echo "Building third-party dependencies..."
echo
if [ "$with_system_cxxtest" = "false" ]; then
./source/cxxtest-4.4/build.sh || die "cxxtest build failed"
# shellcheck disable=SC2086
./source/cxxtest-4.4/build.sh $build_sh_options || die "cxxtest build failed"fi
fi
echo
./source/fcollada/build.sh || die "FCollada build failed"
echo
# shellcheck disable=SC2086
./source/fcollada/build.sh $build_sh_options || die "FCollada build failed"
if [ "$with_system_nvtt" = "false" ] && [ "$without_nvtt" = "false" ]; then
./source/nvtt/build.sh || die "NVTT build failed"
# shellcheck disable=SC2086
./source/nvtt/build.sh $build_sh_options || die "NVTT build failed"
cp source/nvtt/bin/* ../binaries/system/
fi
echo
if [ "$with_system_premake" = "false" ]; then
./source/premake-core/build.sh || die "Premake build failed"
# shellcheck disable=SC2086
./source/premake-core/build.sh $build_sh_options || die "Premake build failed"
fi
echo
if [ "$with_system_mozjs" = "false" ]; then
./source/spidermonkey/build.sh || die "SpiderMonkey build failed"
# shellcheck disable=SC2086
./source/spidermonkey/build.sh $build_sh_options || die "SpiderMonkey build failed"
cp source/spidermonkey/lib/* ../binaries/system/
fi
echo
if [ "$with_spirv_reflect" = "true" ]; then
./source/spirv-reflect/build.sh || die "spirv-reflect build failed"
# shellcheck disable=SC2086
./source/spirv-reflect/build.sh $build_sh_options || die "spirv-reflect build failed"
fi
echo "Done."

View file

@ -6,8 +6,20 @@ cd "$(dirname "$0")"
PV=4.4
LIB_VERSION=${PV}+wfg1
echo "Building CxxTest..."
while [ "$#" -gt 0 ]; do
case "$1" in
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
echo "CxxTest is already up to date."
echo "Skipping - already built (use --force-rebuild to override)"
exit
fi

View file

@ -5,8 +5,20 @@ cd "$(dirname "$0")"
LIB_VERSION=28209
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]; then
echo "FCollada is already up to date."
echo "Building FCollada..."
while [ "$#" -gt 0 ]; do
case "$1" in
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
echo "Skipping - already built (use --force-rebuild to override)"
exit
fi

View file

@ -5,8 +5,20 @@ cd "$(dirname "$0")"
LIB_VERSION=28209
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]; then
echo "NVTT is already up to date."
echo "Building NVTT..."
while [ "$#" -gt 0 ]; do
case "$1" in
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
echo "Skipping - already built (use --force-rebuild to override)"
exit
fi

View file

@ -10,8 +10,20 @@ cd "$(dirname "$0")"
PV=5.0.0-beta2
LIB_VERSION=${PV}+wfg2
echo "Building Premake..."
while [ "$#" -gt 0 ]; do
case "$1" in
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
echo "premake is already up to date."
echo "Skipping - already built (use --force-rebuild to override)"
exit
fi

View file

@ -9,8 +9,20 @@ FOLDER="mozjs-115.16.1"
LIB_VERSION="115.16.1+1"
LIB_NAME="mozjs115"
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]; then
echo "Spidermonkey is already up to date."
echo "Building SpiderMonkey..."
while [ "$#" -gt 0 ]; do
case "$1" in
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
echo "Skipping - already built (use --force-rebuild to override)"
exit
fi

View file

@ -6,8 +6,20 @@ cd "$(dirname "$0")"
PV=1.3.290.0
LIB_VERSION=${PV}
echo "Building SPIRV-Reflect..."
while [ "$#" -gt 0 ]; do
case "$1" in
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
echo "spirv-reflect is already up to date."
echo "Skipping - already built (use --force-rebuild to override)"
exit
fi