37 lines
876 B
Bash
Executable file
37 lines
876 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -o nounset #Error when unset vars are used
|
|
set -o errexit #Exit on errors
|
|
set -o pipefail #Causes failure when input-pipe-program fails
|
|
set -x
|
|
|
|
build_configuration="Debug"
|
|
if [ ! -z ${1:-} ]
|
|
then
|
|
build_configuration=$1
|
|
fi
|
|
|
|
run_target="modelviewer"
|
|
if [ ! -z ${2:-} ]
|
|
then
|
|
run_target=$2
|
|
fi
|
|
|
|
run_command="./build-$build_configuration/src/$run_target ${3:-}"
|
|
|
|
if [ $build_configuration = "mingw" ]; then
|
|
if [ ! -d "build-$build_configuration" ]; then
|
|
if [ $# -ne 2 ]; then
|
|
set +x
|
|
echo "Trying to run \"./run mingw\" for the first time without toolchain file."
|
|
echo "Please specify a cross_compile toolchain file as second argument."
|
|
set -x
|
|
else
|
|
./vanillabuild $build_configuration $2 && $run_command.exe
|
|
fi
|
|
else
|
|
./vanillabuild $build_configuration && $run_command.exe
|
|
fi
|
|
else
|
|
./vanillabuild $build_configuration && $run_command
|
|
fi
|