diff options
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -1,11 +1,12 @@ #!/bin/bash -DEBUG=1 # Compile with debug symbols. -IMGUI=0 # Compile ImGui libs. Our custom ImGui functions still compile on zero. +OPTIMIZATION="-O2" # Enable optimization. +DEBUG=1 # Compile with debug UI. +IMGUI=1 # Compile ImGui libs. Our custom ImGui functions still compile on zero. THREADED=1 # Compile with threading. Useful to disable when stepping through the renderer. WINDOWS=0 # Compile for Windows with Mingw. ARM=0 # Compile on ARM machines. -PACKEDRGB=0 # Use 4x4 chunks for the software rasterizer. +PACKEDRGB=0 # Use 4x4 chunks for the software rasterizer. Isn't actually faster at the moment. PERF=0 # Print cycle stats. FFMPEG_LIBS=" @@ -42,9 +43,6 @@ WARNING_FLAGS=" if [[ "$DEBUG" == 1 ]]; then WARNING_FLAGS="$WARNING_FLAGS -DDEBUG=1" -DEBUG="-g" -else -DEBUG="-O2" fi if [[ "$THREADED" == 1 ]]; then WARNING_FLAGS="$WARNING_FLAGS -DTHREADED=1" @@ -71,11 +69,11 @@ fi if [[ "$OSTYPE" =~ ^darwin ]]; then IMGUI_FLAGS=" - -std=c++11 -Iimgui -Iimgui/backends $DEBUG -Wall -Wformat `sdl2-config --cflags` -I/usr/local/include -I/opt/local/include -c + -std=c++11 -Iimgui -Iimgui/backends $OPTIMIZATION -Wall -Wformat `sdl2-config --cflags` -I/usr/local/include -I/opt/local/include -c " else IMGUI_FLAGS=" - -Iimgui -Iimgui/backends $DEBUG -Wall -Wformat `sdl2-config --cflags` -c + -Iimgui -Iimgui/backends $OPTIMIZATION -Wall -Wformat `sdl2-config --cflags` -c " fi @@ -104,15 +102,15 @@ if [[ "$IMGUI" == 1 ]]; then fi if [[ "$WINDOWS" == 1 ]]; then -clang++ $DEBUG $WARNING_FLAGS -target x86_64-pc-windows-gnu -march=x86-64-v3 -I .. -Iimgui -Iimgui/backends \ +clang++ $OPTIMIZATION $WARNING_FLAGS -target x86_64-pc-windows-gnu -march=x86-64-v3 -I .. -Iimgui -Iimgui/backends \ main.cpp imgui/imgui*.cpp imgui/backends/imgui_impl_sdl.cpp imgui/backends/imgui_impl_opengl3.cpp \ -I/usr/x86_64-w64-mingw32/include/SDL2 -I/usr/x86_64-w64-mingw32/include/GL \ -lmingw32 -lopengl32 -lSDL2main -lSDL2 -llibavcodec -llibswscale -llibavformat -llibavutil \ -o bin/real2d else clang lib/glad.c $GLAD_FLAGS -I/usr/local/include -I/opt/local/include -c \ - $WARNING_FLAGS $DEBUG $ADDITIONAL_FLAGS -o bin/glad.o -clang main.cpp $WARNING_FLAGS $DEBUG $ADDITIONAL_FLAGS -o bin/real2d bin/*.o \ + $WARNING_FLAGS $OPTIMIZATION $ADDITIONAL_FLAGS -o bin/glad.o +clang main.cpp $WARNING_FLAGS $OPTIMIZATION $ADDITIONAL_FLAGS -o bin/real2d bin/*.o \ $GLAD_FLAGS \ -std=c++11 -lstdc++ -Iimgui -Iimgui/backends \ $SDL_ARGS \ |