add dedicated build scripts

This commit is contained in:
Fabien Freling 2022-02-18 12:44:17 +01:00
parent 5b32c517c1
commit 8f4e23452b
3 changed files with 34 additions and 0 deletions

View file

@ -77,6 +77,9 @@ where the mask is set to zero.
In order to easily debug and better visualize the problem, I chose to implement
a minimal GUI using [raylib][3].
You can build it with `./build-gui.sh` (you need to installed [raylib required
libraries](https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux)).
You can add, move, and resize boxes. Processing steps are triggered with
buttons.
@ -85,6 +88,9 @@ buttons.
A commandline sample is also available, in case the raylib library cannot be
built, or if we need to benchmark performance.
You can build it with `./build-cli.sh` (you need to installed [raylib required
libraries](https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux)).
## PNG support
I chose to support PNG files through the stb files:

14
build-cli.sh Executable file
View file

@ -0,0 +1,14 @@
#! /bin/sh -e
export tup_vardict="/home/fabs/Code/netatmo-algo/tup-generate.vardict"
cd "src"
(clang++ -c a2.cpp -o a2.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c bounding_box.cpp -o bounding_box.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c frame.cpp -o frame.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c mapping.cpp -o mapping.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c mask.cpp -o mask.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c pack.cpp -o pack.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c png.cpp -o png.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(ar rcs libpacking.a a2.o bounding_box.o frame.o mapping.o mask.o pack.o png.o)
(clang++ -c main_cli.cpp -o main_cli.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c png_impl.cpp -o png_impl.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ libpacking.a main_cli.o png_impl.o -o ../packing_cli -L. -lpacking)

14
build-gui.sh Executable file
View file

@ -0,0 +1,14 @@
#! /bin/sh -e
export tup_vardict="/home/fabs/Code/netatmo-algo/tup-generate.vardict"
cd "src"
(clang++ -c a2.cpp -o a2.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c bounding_box.cpp -o bounding_box.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c frame.cpp -o frame.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c mapping.cpp -o mapping.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c mask.cpp -o mask.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c pack.cpp -o pack.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(clang++ -c png.cpp -o png.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb)
(ar rcs libpacking.a a2.o bounding_box.o frame.o mapping.o mask.o pack.o png.o)
(cd 3rd-party/raylib-4.0.0/src && make CC=clang PLATFORM=PLATFORM_DESKTOP RAYLIB_MODULE_AUDIO=FALSE RAYLIB_MODULE_MODELS=FALSE)
(clang++ -c main_gui.cpp -o main_gui.o -Wall -Werror -std=c++17 -fcolor-diagnostics -g -O1 -I./3rd-party/stb -I3rd-party/raylib-4.0.0/src)
(clang++ libpacking.a main_gui.o -o ../packing_gui -L. -lpacking -L3rd-party/raylib-4.0.0 -lraylib -lGL -lc -lm -lpthread -ldl -lrt -lX11)