-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauto-build.sh
More file actions
50 lines (45 loc) · 880 Bytes
/
auto-build.sh
File metadata and controls
50 lines (45 loc) · 880 Bytes
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
#!/bin/bash
# Check cmake version
ver=`cmake --version | head -n 1 | awk -F " " '{print $3}'`
ver1=`echo $ver | awk -F . '{print $1}'`
ver2=`echo $ver | awk -F . '{print $2}'`
echo $ver $ver1 $ver2
if [ $ver1 -lt 4 ] && [ $ver2 -lt 13 ]
then
echo "cmake version should be higher than 3.13"
exit
fi
# Check nng library
if [ -e "/usr/local/include/nng" ]
then
echo nng exists
else
# Get nng src
if ! [ -e "./lib/nng/src" ]
then
echo Can not find nng src files.
echo Git clone nng from Gitee.
mkdir lib &&
cd ./lib &&
git clone https://gitee.com/mirrors/nng.git &&
cd ..
fi
# Build nng
echo Build nng first.
cd ./lib/nng/ &&
mkdir build
cd build &&
cmake .. &&
make -j4 &&
make install
cd ../../../
fi
# Build targets
if ! [ -e "./build" ]
then
mkdir build
fi
cd build &&
cmake .. &&
make -j4 &&
echo lutf build complete