-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
34 lines (28 loc) · 752 Bytes
/
build.sh
File metadata and controls
34 lines (28 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! bin/bash
FRAMEWORKS='-framework AppKit -framework Metal -framework MetalKit -framework CoreVideo -framework GameController'
FLAGS='-std=c++20 --debug -Ilibs/imgui -Ilibs/imgui/backends'
TIMEFORMAT=%R
IGNORE='-Wno-nullability-completeness -Wno-unused-command-line-argument'
BUILD_TYPE=$1
all()
{
rm -rf CNC_ImGui.o
clang++ ${FRAMEWORKS} -c CNC_ImGui.mm ${FLAGS} ${IGNORE}
platform
}
platform()
{
clang++ ${FRAMEWORKS} CNC_Main.mm -o userinterface CNC_ImGui.o ${FLAGS} ${IGNORE}
}
main()
{
if [ "$BUILD_TYPE" = "ALL" ]
then
time all
else
time platform
fi
CODE_SIZE=$(cloc --exclude-list-file=.clocignore . | grep -o -E '([0-9]+)' | tail -1)
echo "-> LINES OF CODE: " $CODE_SIZE
}
main