-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·61 lines (49 loc) · 1.32 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
59
60
61
if ! dpkg -l | grep -qw build-essential; then
sudo apt-get install -y build-essential
fi
if ! dpkg -l | grep -qw cmake; then
sudo apt-get install -y cmake
fi
if ! dpkg -l | grep -qw ninja-build; then
sudo apt-get install -y ninja-build
fi
if ! dpkg -l | grep -qw libsdl2-dev; then
sudo apt-get install -y libsdl2-dev libgl1-mesa-dev
fi
# install vcpkg & libraries
if [ ! -d "./tools/vcpkg" ]
then
cd tools
git clone https://github.com/microsoft/vcpkg
sudo ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
sudo ./vcpkg/vcpkg install \
glm \
lz4 \
robin-hood-hashing \
spdlog \
bshoshany-thread-pool \
yaml-cpp \
imgui[opengl3-binding,sdl2-binding] \
concurrentqueue
cd ..
fi
BASE_DIR=$(dirname "$0")
BUILD_DIR=${BASE_DIR}/build
cmake \
-G "Ninja" \
-DCMAKE_TOOLCHAIN_FILE=${BASE_DIR}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_BUILD_TYPE=Release \
-B${BASE_DIR}/out \
--no-warn-unused-cli
cmake --build out --config Debug
# create build
mkdir -p build
echo Copy execute files and resource files
# copy resources
rm -rf ${BUILD_DIR}/resources
cp -r resources ${BUILD_DIR}/resources
# copy execute file
cp -r out/cybrion build/cybrion
echo Build completed