diff --git a/build.sh b/build.sh index 768ee9a..f162137 100755 --- a/build.sh +++ b/build.sh @@ -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" +