-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
executable file
·56 lines (53 loc) · 1.41 KB
/
build
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
#!/bin/bash
usage()
{
echo ""
echo "Usage: `basename $0` [options] [-jn] [-v] [-h]"
echo "Options:"
echo " release, debug: "
echo " Specifies the build type."
echo " ia32, x64, arm, arm64, mips, mips64, ppc, ppc64:"
echo " Specifies the architecture for code generation."
echo " clean: "
echo " Clean the build folder."
echo " ci: "
echo " Specifies the environment is CI."
echo " -h, --help:"
echo " Print this message and exit."
echo " -j: enable make '-j' option."
echo " if 'n' is not given, will set jobs to auto detected core count, otherwise n is used."
echo " --use-msvc:"
echo " force use msvc on Windows, default is clangcl."
echo ""
}
for i in "$@"
do
case $i in
ia32|x64|arm|arm64|armv6|mips|mips64|ppc|ppc64) BUILD_ARCH=$i
;;
release|debug) BUILD_TYPE=$i
;;
clean) CLEAN_BUILD="true"
;;
ci) CI="ci"
;;
-j*) BUILD_JOBS="${i#-j}"
;;
--help|-h) usage
exit 1
;;
--use-msvc)
BUILD_WITH_MSVC=true
;;
*) echo "illegal option $i"
usage
exit 1
;;
esac
done
cmake -DBUILD_ARCH=${BUILD_ARCH}\
-DBUILD_TYPE=${BUILD_TYPE}\
-DCLEAN_BUILD=${CLEAN_BUILD}\
-DBUILD_JOBS=${BUILD_JOBS}\
-DBUILD_WITH_MSVC=${BUILD_WITH_MSVC} \
-P build.cmake