fix viewer build

Diffs=
a8c86e949 fix viewer build (#6527)

Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
This commit is contained in:
luigi-rosso
2024-01-27 22:20:31 +00:00
parent 3255a2aeb2
commit bf1e8f8eff
6 changed files with 71 additions and 33 deletions

View File

@@ -0,0 +1,59 @@
#!/bin/sh
set -e
source ../../../../dependencies/macosx/config_directories.sh
CONFIG=debug
GRAPHICS=gl
OTHER_OPTIONS=
for var in "$@"; do
if [[ $var = "release" ]]; then
CONFIG=release
fi
if [[ $var = "gl" ]]; then
GRAPHICS=gl
fi
if [[ $var = "d3d" ]]; then
GRAPHICS=d3d
fi
if [[ $var = "metal" ]]; then
GRAPHICS=metal
fi
if [[ $var = "text" ]]; then
OTHER_OPTIONS+=--with_rive_text
fi
done
if [[ ! -f "$DEPENDENCIES/bin/premake5" ]]; then
pushd $DEPENDENCIES_SCRIPTS
./get_premake5.sh
popd
fi
if [[ ! -d "$DEPENDENCIES/sokol" ]]; then
pushd $DEPENDENCIES_SCRIPTS
./get_sokol.sh
popd
fi
if [[ ! -f "$DEPENDENCIES/skia/out/$GRAPHICS/$CONFIG/libskia.a" ]]; then
pushd $DEPENDENCIES_SCRIPTS
./make_viewer_skia.sh $GRAPHICS $CONFIG
popd
fi
export PREMAKE=$DEPENDENCIES/bin/premake5
pushd ..
$PREMAKE --scripts=../../../build --file=./premake5.lua gmake2 $OTHER_OPTIONS
for var in "$@"; do
if [[ $var = "clean" ]]; then
make clean
make config=release clean
fi
done
make config=$CONFIG -j$(($(sysctl -n hw.physicalcpu) + 1))
popd