-
Notifications
You must be signed in to change notification settings - Fork 8
/
game.sh
44 lines (34 loc) · 1.27 KB
/
game.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
#!/bin/sh
set -eu
. ./config
# Initialization
if [ ! -e "$ROR_SOURCE_DIR" ]; then
mkdir -p "$ROR_SOURCE_DIR"
fi
cd "$ROR_SOURCE_DIR"
if [ ! -e rigs-of-rods ]; then
git clone https://github.com/${YOUR_GITHUB_USERNAME}/rigs-of-rods.git --depth=5
fi
cd rigs-of-rods
git pull
if [ ! -e "0_build/$CMAKEBUILDTYPE" ]; then
mkdir -p 0_build/$CMAKEBUILDTYPE
fi
cd 0_build/$CMAKEBUILDTYPE
conan install --build=missing -u ../../
cmake ../../ -GNinja \
-DCMAKE_BUILD_TYPE=$CMAKEBUILDTYPE \
-DBUILD_CUSTOM_VERSION=ON \
-DCUSTOM_VERSION="0.4.8.0-shscript" \
-DCMAKE_CXX_FLAGS="-pipe -march=native"
# CMAKE_CXX_FLAGS (flags for compiler) - Default are:
# -march=native -- Optimize RoR for the CPU the build is performed on; executable will only be portable to systems with same or newer CPU architecture
# -pipe -- Speeds up the compilation process. Requires >=4GB RAM.
# Optimization flags. Pick some if you want to play around with optimization
# -DCMAKE_CXX_FLAGS="-Ofast -march=native -pipe -flto -mfpmath=both -funroll-loops -floop-parallelize-all -ftree-parallelize-loops=4" \
ninja
ninja zip_and_copy_resources
sudo ninja install
echo "$(tput setaf 2)Build succeeded!"
echo "NOTE: Do not forget to run RoRConfig once before RoR."
echo "NOTE: Mods belong in ~/.rigsofrods/packs"