Update build for linux
This commit is contained in:
21
build.sh
21
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
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user