From 52390a7aa80225e0065d1179deaf889def51b141 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Sat, 31 Jan 2026 22:47:03 +0100 Subject: [PATCH] Update build for linux --- build.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index aeef403..8da770d 100755 --- a/build.sh +++ b/build.sh @@ -1,10 +1,21 @@ #!/usr/bin/bash -mkdir build +for arg in "$@"; do declare $arg='1'; done +if [ ! -v release ]; then debug=1; fi +if [ -v debug ]; then echo "[debug build]"; fi +if [ -v release ]; then echo "[release build]"; fi +if [ -v slow ]; then echo "[slow build]"; fi + +mkdir -p build cd build -FLAGS="-Wall -Wno-missing-braces -Wno-writable-strings -nostdlib++ -fsanitize=address -fno-exceptions -fdiagnostics-absolute-paths -g -I../src -DDEBUG_BUILD=1" -I="-I../src/external/SDL/include -I../src/external/lua/src -I../src/external/glad" -clang -o te $FLAGS ../src/text_editor/text_editor.cpp $I -lSDL3 -lm -lbacktrace +I="-I../src/external/SDL/include -I../src/external/lua/src -I../src/external/glad -I../src" +flags="-Wall -Wextra -Werror -Wformat=2 -Wundef -Wshadow -Wno-missing-field-initializers -Wno-missing-braces -Wno-writable-strings \ + -g -fdiagnostics-absolute-paths \ + -nostdlib++ -fno-exceptions" -# -v -Wl,--verbose \ No newline at end of file +if [ -v debug ]; then flags="$flags -fsanitize=address,undefined -fno-omit-frame-pointer -DDEBUG_BUILD=1"; fi +if [ -v release ]; then flags="$flags -DDEBUG_BUILD=0 -O2"; fi +if [ -v slow ]; then flags="$flags -DSLOW_BUILD=1"; fi + +time clang -o te $flags ../src/text_editor/text_editor.cpp $I -lSDL3 -lm -lbacktrace