This repository was archived by the owner on Apr 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.linux.sh
More file actions
executable file
·59 lines (48 loc) · 1.57 KB
/
build.linux.sh
File metadata and controls
executable file
·59 lines (48 loc) · 1.57 KB
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
#!/bin/bash
set -e
set -x
cd "$(dirname "$0")"
ROOT=$(pwd)
cd $ROOT
sed -i -e 's/add_subdirectory\(docs\)/#add_subdirectory\(docs\)/g' curl/CMakeLists.txt
# Builds are faster if we don't clear the CMake cache.
SHASUM=$(shasum CMakeLists.txt | awk '{print $1}')
VERSION=v2
if [ -d buildlinux32_${SHASUM}_${VERSION} ]; then
rm -Rf buildlinux32_${SHASUM}_${VERSION}
fi
mkdir buildlinux32_${SHASUM}_${VERSION}
cd buildlinux32_${SHASUM}_${VERSION}
cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=../toolchain/Linux-i386.cmake ..
make
cd $ROOT
if [ -d buildlinux64_${SHASUM}_${VERSION} ]; then
rm -Rf buildlinux64_${SHASUM}_${VERSION}
fi
mkdir buildlinux64_${SHASUM}_${VERSION}
cd buildlinux64_${SHASUM}_${VERSION}
cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=../toolchain/Linux-x86_64.cmake ..
make
echo "Testing 32-bit binaries..."
cd $ROOT/buildlinux32_${SHASUM}_${VERSION}/Release
./HiveMP.SteamTest-exe | tee result.txt
if [ "$(cat result.txt | grep -c "TEST PASS")" != "2" ]; then
echo "Test failed!"
exit 1
fi
echo "Testing 64-bit binaries..."
cd $ROOT/buildlinux64_${SHASUM}_${VERSION}/Release
./HiveMP.SteamTest-exe | tee result.txt
if [ "$(cat result.txt | grep -c "TEST PASS")" != "2" ]; then
echo "Test failed!"
exit 1
fi
cd $ROOT
echo "Creating distribution structure..."
if [ -d dist ]; then
rm -Rf dist
fi
mkdir -pv dist/sdk/Linux32
mkdir -pv dist/sdk/Linux64
cp buildlinux32_${SHASUM}_${VERSION}/Release/*.so dist/sdk/Linux32/
cp buildlinux64_${SHASUM}_${VERSION}/Release/*.so dist/sdk/Linux64/