-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare.sh
61 lines (52 loc) · 1.27 KB
/
prepare.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
59
60
61
#!/bin/bash
set -e # Exit on error
echo "Starting preparation..."
# Check if git is available
if ! command -v git &> /dev/null; then
echo "Error: git is not installed. Please install git and try again."
exit 1
fi
# Check if .git directory exists
if [ ! -d ".git" ]; then
echo "Error: Not a git repository"
exit 1
fi
# Check git submodules status
echo "Checking git submodules..."
if git submodule status | grep '^-' &> /dev/null; then
echo "Some submodules are not initialized. Initializing..."
git submodule update --init --recursive --remote || {
echo "Error initializing submodules"
exit 1
}
else
echo "Updating submodules..."
git submodule update --recursive --remote || {
echo "Error updating submodules"
exit 1
}
fi
# Check for C++ compiler
if ! command -v g++ &> /dev/null; then
echo "ERROR: C++ compiler not found"
exit 1
fi
# Build VMA
echo "Building VMA..."
pushd libs/vma || exit 1
source ./build.sh 3 || {
echo "Error occurred while building VMA"
popd
exit 1
}
popd
# Build ImGui
echo "Building ImGui..."
pushd libs/imgui || exit 1
source ./build.sh glfw vulkan || {
echo "Error occurred while building ImGui"
popd
exit 1
}
popd
echo "All operations completed successfully."