fix script

This commit is contained in:
Matthew 2025-08-16 12:00:43 +10:00
parent a91b50cb90
commit a339af82ab

View File

@ -9,6 +9,8 @@ fi
script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
build="$1" build="$1"
mkdir -p $build
if [ -x "$(command -v g++)" ]; then cpp_compiler="g++"; c_compiler="gcc"; if [ -x "$(command -v g++)" ]; then cpp_compiler="g++"; c_compiler="gcc";
elif [ -x "$(command -v clang++)" ]; then cpp_compiler="clang++"; c_compiler="clang"; elif [ -x "$(command -v clang++)" ]; then cpp_compiler="clang++"; c_compiler="clang";
else echo "Unable to find c++ cpp_compiler"; exit -1; fi; else echo "Unable to find c++ cpp_compiler"; exit -1; fi;
@ -18,6 +20,9 @@ elif [ -x "$(command -v lld)" ]; then linker_cmd="-fuse-ld=lld";
elif [ -x "$(command -v ld)" ]; then linker_cmd="-fuse-ld=ld"; elif [ -x "$(command -v ld)" ]; then linker_cmd="-fuse-ld=ld";
else echo "Unable to find c/c++ linker"; exit -1; fi; else echo "Unable to find c/c++ linker"; exit -1; fi;
# COMPILER FLAGS
out="-o"
# STB_IMAGE # STB_IMAGE
src="${script_dir}/external/stb/stb.c" src="${script_dir}/external/stb/stb.c"
flags="-std=c99 -Wno-everything -Iexternal/stb -c -static" flags="-std=c99 -Wno-everything -Iexternal/stb -c -static"