forked from OpenVisualCloud/Media-Transport-Library
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·106 lines (92 loc) · 2.14 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·106 lines (92 loc) · 2.14 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
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
#!/bin/bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2022 Intel Corporation
set -e
function usage()
{
echo "Usage: $0 [debug/debugoptimized/plain/release]"
exit 0
}
buildtype=release
disable_pcapng=false
enable_asan=false
enable_kni=false
enable_tap=false
if [ -n "$MTL_BUILD_DISABLE_PCAPNG" ]; then
if [ $MTL_BUILD_DISABLE_PCAPNG == "true" ]; then
disable_pcapng=true
echo "Disable pcapng function."
fi
fi
if [ -n "$MTL_BUILD_ENABLE_ASAN" ]; then
if [ $MTL_BUILD_ENABLE_ASAN == "true" ]; then
enable_asan=true
buildtype=debug # use debug build as default for asan
echo "Enable asan check."
fi
fi
if [ -n "$MTL_BUILD_ENABLE_KNI" ]; then
if [ $MTL_BUILD_ENABLE_KNI == "true" ]; then
enable_kni=true
echo "Enable kni"
fi
fi
if [ -n "$MTL_BUILD_ENABLE_TAP" ]; then
if [ $MTL_BUILD_ENABLE_TAP == "true" ]; then
enable_tap=true
echo "Enable tap"
fi
fi
if [ -n "$1" ]; then
case $1 in
"debug")
buildtype=debug
enable_asan=true
;;
"debugoptimized")
buildtype=debugoptimized
;;
"plain")
buildtype=plain
;;
"release")
buildtype=release
;;
*)
usage
;;
esac
fi
WORKSPACE=$PWD
LIB_BUILD_DIR=${WORKSPACE}/build
APP_BUILD_DIR=${WORKSPACE}/build/app
TEST_BUILD_DIR=${WORKSPACE}/build/tests
PLUGINS_BUILD_DIR=${WORKSPACE}/build/plugins
# build lib
meson ${LIB_BUILD_DIR} -Dbuildtype=$buildtype -Ddisable_pcapng=$disable_pcapng -Denable_asan=$enable_asan -Denable_kni=$enable_kni -Denable_tap=$enable_tap
pushd ${LIB_BUILD_DIR}
ninja
sudo ninja install
popd
# build app
pushd app/
meson ${APP_BUILD_DIR} -Dbuildtype=$buildtype -Denable_asan=$enable_asan
popd
pushd ${APP_BUILD_DIR}
ninja
popd
# build tests
pushd tests/
meson ${TEST_BUILD_DIR} -Dbuildtype=$buildtype -Denable_asan=$enable_asan
popd
pushd ${TEST_BUILD_DIR}
ninja
popd
# build plugins
pushd plugins/
meson ${PLUGINS_BUILD_DIR} -Dbuildtype=$buildtype -Denable_asan=$enable_asan
popd
pushd ${PLUGINS_BUILD_DIR}
ninja
sudo ninja install
popd