-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
168 lines (103 loc) · 4.23 KB
/
deploy.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/bin/sh
set -e
#--------------------------------------------------------------------------------------------------
# Settings
#--------------------------------------------------------------------------------------------------
libtorrent_versionA="2.0.10"
libtorrent_versionB="2.0"
Boost_version="1.86.0"
#--------------------------------------------------------------------------------------------------
# Syntax
#--------------------------------------------------------------------------------------------------
if [ $# != 1 ] \
|| \
[ $1 != "win32" -a $1 != "win64" -a $1 != "win32-msvc" -a $1 != "win64-msvc" -a \
$1 != "macOS" -a $1 != "linux" -a $1 != "androidv7" -a $1 != "androidv8" -a \
$1 != "android32" -a $1 != "android64" ]; then
echo "Usage: deploy <win32 | win64 | win32-msvc | win64-msvc | macOS | linux |"
echo " androidv7 | androidv8 | android32 | android64>"
exit 1
fi
#--------------------------------------------------------------------------------------------------
# Configuration
#--------------------------------------------------------------------------------------------------
if [ $1 = "win32" -o $1 = "win64" -o $1 = "win32-msvc" -o $1 = "win64-msvc" ]; then
os="windows"
if [ $1 = "win32" -o $1 = "win64" ]; then
compiler="mingw"
else
compiler="msvc"
fi
if [ $1 = "win32" -o $1 = "win32-msvc" ]; then
target="32"
else
target="64"
fi
elif [ $1 = "androidv7" -o $1 = "androidv8" -o $1 = "android32" -o $1 = "android64" ]; then
os="android"
compiler="default"
if [ $1 = "androidv7" ]; then
abi="armeabi-v7a"
elif [ $1 = "androidv8" ]; then
abi="arm64-v8a"
elif [ $1 = "android32" ]; then
abi="x86"
elif [ $1 = "android64" ]; then
abi="x86_64"
fi
else
os="default"
compiler="default"
fi
#--------------------------------------------------------------------------------------------------
# Deploy
#--------------------------------------------------------------------------------------------------
echo "DEPLOYING"
path="deploy/Boost/$Boost_version"
if [ $os = "android" ]; then
mkdir -p $path/$abi
else
mkdir -p $path
fi
cp -r boost/boost $path/Boost
if [ $compiler = "mingw" ]; then
cp libtorrent/build/lib/libboost_system-mgw*-mt-x$target-*.dll.a $path/libboost_system.a
cp libtorrent/build/lib/libboost_system-mgw*-mt-x$target-*.dll $path/libboost_system.dll
elif [ $1 = "win32-msvc" ]; then
cp libtorrent/build/lib/boost_system-vc*-mt-x$target-*.lib $path/boost_system.lib
cp libtorrent/build/lib/boost_system-vc*-mt-x$target-*.dll $path/boost_system.dll
elif [ $1 = "win64-msvc" ]; then
cp libtorrent/build/lib/boost_system-vc*-mt-x$target-*.lib $path/boost_system.lib
cp libtorrent/build/lib/boost_system-vc*-mt-x$target-*.dll $path/boost_system.dll
elif [ $1 = "macOS" ]; then
cp libtorrent/build/lib/libboost_system.dylib $path/libboost_system.dylib
elif [ $1 = "linux" ]; then
cp libtorrent/build/lib/libboost_system.so.$Boost_version $path/libboost_system.so
elif [ $os = "android" ]; then
cp libtorrent/build/lib/libboost_system.a $path/$abi
fi
#--------------------------------------------------------------------------------------------------
path="deploy/libtorrent/$libtorrent_versionA"
if [ $os = "android" ]; then
mkdir -p $path/$abi
else
mkdir -p $path
fi
cp -r libtorrent/include/libtorrent $path
if [ $compiler = "mingw" ]; then
cp libtorrent/build/lib/libtorrent.dll.a $path/libtorrent.a
cp libtorrent/build/lib/libtorrent-rasterbar.dll $path
elif [ $compiler = "msvc" ]; then
cp libtorrent/build/lib/torrent.lib $path
cp libtorrent/build/lib/torrent-rasterbar.dll $path
elif [ $1 = "macOS" ]; then
cp libtorrent/build/lib/libtorrent-rasterbar.dylib.$libtorrent_versionB \
$path/libtorrent-rasterbar.dylib
elif [ $1 = "linux" ]; then
cp libtorrent/build/lib/libtorrent-rasterbar.so.$libtorrent_versionB \
$path/libtorrent-rasterbar.so
elif [ $os = "android" ]; then
# NOTE: This library is required when building against libtorrent-rasterbar.
cp libtorrent/build/lib/libtry_signal.a $path/$abi
cp libtorrent/build/lib/libtorrent-rasterbar.a $path/$abi
fi