Red screen on Linux

Oddly no validation error
This commit is contained in:
2025-10-03 20:42:04 +01:00
parent 655964852c
commit 9f2ef576b9
4 changed files with 100 additions and 0 deletions

50
linux Executable file
View File

@@ -0,0 +1,50 @@
#!/bin/sh
set -e
pushd "$(dirname $0)" > /dev/null
if [[ ! -d "build" ]];
then
mkdir "build"
fi
pushd "build" > /dev/null
release=0
deps=0
for a in $*
do
let $a=1
done
if [[ ! -d "deps" ]]
then
deps=1
fi
if [[ $deps == 1 ]]
then
# We don't build SDL3 like on windows, this assumes you have it installed instead. We can't
# just ship with the version of SDL3 we want because the shared object system is bad
echo "[Building dependencies]"
rm -rf "deps"
mkdir -p "deps/stb"
cp ../thirdparty/stb/*.h deps/stb
fi
echo "[Building source]"
COMPILER_OPTS="-Wall -Wno-missing-braces -I'deps/stb'"
LINKER_OPTS="-lSDL3"
if [[ $release == 1 ]]
then
echo "[Release build]"
gcc -O2 -Werror $COMPILER_OPTS -DLD_RELEASE=1 $(realpath "../code/first.c") -o "ludum" $LINKER_OPTS
else
echo "[Debug build]"
gcc -O0 -g -ggdb $COMPILER_OPTS $(realpath "../code/first.c") -o "ldebug" $LINKER_OPTS
fi