From 93f6cb2a1b224235a6bc72c92e7912b3daf3983b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 17 May 2023 18:49:39 +0200 Subject: Add debug option to build script --- build.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'build.sh') diff --git a/build.sh b/build.sh index 563cfec..572d354 100755 --- a/build.sh +++ b/build.sh @@ -1,8 +1,11 @@ #!/bin/sh -e +opts="-O2 -g0 -DNDEBUG -Wall -Wextra -Werror -s" +[ -n "$DEBUG" ] && opts="-O0 -g3 -Wall -Wextra -Werror"; + dependencies="gtk+-3.0 x11 xrandr libpulse" includes="$(pkg-config --cflags $dependencies)" libs="$(pkg-config --libs $dependencies) -ldl" -gcc -c src/egl.c -O2 -g0 -DNDEBUG $includes -g++ -c src/main.cpp -O2 -g0 -DNDEBUG $includes -g++ -o gpu-screen-recorder-gtk -O2 egl.o main.o -s $libs +gcc -c src/egl.c $opts $includes +g++ -c src/main.cpp $opts $includes +g++ -o gpu-screen-recorder-gtk -O2 egl.o main.o $libs $opts -- cgit v1.2.3