-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
58 lines (43 loc) · 1.15 KB
/
build.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Function to check if a command executed successfully
check_success() {
if [ $? -ne 0 ]; then
echo "Error: $1 failed."
exit 1
fi
}
echo "Cloning the latest glm, glfw, and imgui libraries"
# Clone glm
git clone https://github.com/g-truc/glm
check_success "Cloning glm"
# Clone glfw
git clone https://github.com/glfw/glfw.git
check_success "Cloning glfw"
# Clone imgui (docking branch)
git clone https://github.com/ocornut/imgui --branch docking
check_success "Cloning imgui"
# Move directories to vendor folder
cp -r glm/ vendor/glm
check_success "Moving glm"
cp -r glfw/ vendor/GLFW
check_success "Copying glfw"
cp -r imgui/ vendor/imgui
check_success "Moving imgui"
# Delete original directories
rm -rf glm/
check_success "Deleting glm"
rm -rf glfw/
check_success "Deleting glfw"
rm -rf imgui/
check_success "Deleting imgui"
echo "Building project for architecture arm64"
# Create build directory and generate build files
cmake -S . -B build
check_success "CMake configuration"
# Build project
cd build || exit
make
check_success "Build"
# Run the WalnutApp executable
./WalnutApp/WalnutApp
check_success "Running WalnutApp"