aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh47
1 files changed, 25 insertions, 22 deletions
diff --git a/build.sh b/build.sh
index 27e4268..51bb745 100755
--- a/build.sh
+++ b/build.sh
@@ -1,39 +1,42 @@
#!/bin/sh -e
-opts="-O2 -g0 -DNDEBUG -Wall -Wextra -s"
+CC=${CC:-gcc}
+CXX=${CXX:-g++}
+
+opts="-O2 -g0 -DNDEBUG -Wall -Wextra"
[ -n "$DEBUG" ] && opts="-O0 -g3 -Wall -Wextra";
build_gsr_kms_server() {
dependencies="libdrm"
includes="$(pkg-config --cflags $dependencies)"
libs="$(pkg-config --libs $dependencies) -ldl"
- gcc -c kms/server/kms_server.c $opts $includes
- gcc -o gsr-kms-server -O2 kms_server.o $libs $opts
+ $CC -c kms/server/kms_server.c $opts $includes
+ $CC -o gsr-kms-server -O2 kms_server.o $libs $opts
}
build_gsr() {
dependencies="libavcodec libavformat libavutil x11 xcomposite xrandr xfixes libpulse libswresample libavfilter libva libcap"
includes="$(pkg-config --cflags $dependencies)"
libs="$(pkg-config --libs $dependencies) -ldl -pthread -lm"
- gcc -c src/capture/capture.c $opts $includes
- gcc -c src/capture/nvfbc.c $opts $includes
- gcc -c src/capture/xcomposite_cuda.c $opts $includes
- gcc -c src/capture/xcomposite_vaapi.c $opts $includes
- gcc -c src/capture/kms_vaapi.c $opts $includes
- gcc -c kms/client/kms_client.c $opts $includes
- gcc -c src/egl.c $opts $includes
- gcc -c src/cuda.c $opts $includes
- gcc -c src/xnvctrl.c $opts $includes
- gcc -c src/overclock.c $opts $includes
- gcc -c src/window_texture.c $opts $includes
- gcc -c src/shader.c $opts $includes
- gcc -c src/color_conversion.c $opts $includes
- gcc -c src/cursor.c $opts $includes
- gcc -c src/utils.c $opts $includes
- gcc -c src/library_loader.c $opts $includes
- g++ -c src/sound.cpp $opts $includes
- g++ -c src/main.cpp $opts $includes
- g++ -o gpu-screen-recorder -O2 capture.o nvfbc.o kms_client.o egl.o cuda.o xnvctrl.o overclock.o window_texture.o shader.o color_conversion.o cursor.o utils.o library_loader.o xcomposite_cuda.o xcomposite_vaapi.o kms_vaapi.o sound.o main.o $libs $opts
+ $CC -c src/capture/capture.c $opts $includes
+ $CC -c src/capture/nvfbc.c $opts $includes
+ $CC -c src/capture/xcomposite_cuda.c $opts $includes
+ $CC -c src/capture/xcomposite_vaapi.c $opts $includes
+ $CC -c src/capture/kms_vaapi.c $opts $includes
+ $CC -c kms/client/kms_client.c $opts $includes
+ $CC -c src/egl.c $opts $includes
+ $CC -c src/cuda.c $opts $includes
+ $CC -c src/xnvctrl.c $opts $includes
+ $CC -c src/overclock.c $opts $includes
+ $CC -c src/window_texture.c $opts $includes
+ $CC -c src/shader.c $opts $includes
+ $CC -c src/color_conversion.c $opts $includes
+ $CC -c src/cursor.c $opts $includes
+ $CC -c src/utils.c $opts $includes
+ $CC -c src/library_loader.c $opts $includes
+ $CXX -c src/sound.cpp $opts $includes
+ $CXX -c src/main.cpp $opts $includes
+ $CXX -o gpu-screen-recorder -O2 capture.o nvfbc.o kms_client.o egl.o cuda.o xnvctrl.o overclock.o window_texture.o shader.o color_conversion.o cursor.o utils.o library_loader.o xcomposite_cuda.o xcomposite_vaapi.o kms_vaapi.o sound.o main.o $libs $opts
}
build_gsr_kms_server