update script

This commit is contained in:
Matthew 2026-06-19 17:48:57 +10:00
parent 37661c07ac
commit 53eb211a1e

View File

@ -2,7 +2,12 @@
set -eu
script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
build="$script_dir/build"
base_dir="$1"
if [ -z "$base_dir" ]; then
base_dir="$script_dir"
fi
build="$base_dir/build"
if [ -x "$(command -v g++)" ]; then cpp_compiler="g++"; c_compiler="gcc";
elif [ -x "$(command -v clang++)" ]; then cpp_compiler="clang++"; c_compiler="clang";
@ -68,3 +73,4 @@ base_name=$(basename -- "$shader" .glsl)
$shader_compiler $shader_flags $shader_stage $shader "${shader_out}${base_name}.spv"