-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathquickbuild.sh
More file actions
executable file
·168 lines (153 loc) · 3.26 KB
/
Copy pathquickbuild.sh
File metadata and controls
executable file
·168 lines (153 loc) · 3.26 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
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/bash
curr=`basename $(pwd)`
if [[ "$curr" != "build" ]]; then
echo "Not in build directory"
exit 1;
fi
. ../build_common.sh
trap cleanup SIGINT SIGTERM
POSITIONAL_ARGS=()
ASAN=1
TSAN=0
BUILDTYPE="Debug"
RUN_EXAMPLES=0
RUN_BENCHMARKS=0
RUN_TESTS=1
IODEBUG=0
DEBUG=0
CCOMP=clang-19
CXXCOMP=clang++-19
BOOST=0
SPDLOG=0
HIREDIS=0
URING=1
SDEVENT=0
MOLD=1
LD_PATH=
FORCE_32=0
FORCE_32_TOOLCHAIN=
NO_BUILD=0
while [[ $# -gt 0 ]]; do
case $1 in
--gcc)
CCOMP=gcc
CXXCOMP=g++
LD_PATH="/opt/gcc/14/lib64/"
shift # past value
;;
--oldgcc)
CCOMP=gcc-12
CXXCOMP=g++-12
shift # past value
;;
--oldclang)
CCOMP=clang-15
CXXCOMP=clang++-15
shift # past value
;;
--tsan)
ASAN=0
TSAN=1
shift # past value
;;
--nosan)
ASAN=0
TSAN=0
shift # past value
;;
--release)
ASAN=0
TSAN=0
BUILDTYPE="Release"
shift # past value
;;
--iodebug)
IODEBUG=1
shift # past value
;;
--debug)
DEBUG=1
shift # past value
;;
--examples)
RUN_EXAMPLES=1
shift # past value
;;
--benchmarks)
RUN_BENCHMARKS=1
shift # past value
;;
--no-tests)
RUN_TESTS=0
shift # past value
;;
--boost)
BOOST=1
shift # past value
;;
--spdlog)
SPDLOG=1
shift # past value
;;
--hiredis)
HIREDIS=1
shift # past value
;;
--no-uring)
URING=0
shift # past value
;;
--sdevent)
SDEVENT=1
shift # past value
;;
--no-mold)
MOLD=0
shift # past value
;;
--32)
FORCE_32=1
FORCE_32_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=../toolchain-i386.cmake
shift # past value
;;
--no-build)
NO_BUILD=1
shift # past value
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument
;;
esac
done
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
if [[ -n "$LD_PATH" ]]; then
if [[ -n "$LD_LIBRARY_PATH" ]]; then
export LD_LIBRARY_PATH=$LD_PATH:$LD_LIBRARY_PATH
else
export LD_LIBRARY_PATH=$LD_PATH
fi
fi
if [[ "$NO_BUILD" -ne 1 ]]; then
rm -rf ./*
rm -rf ../bin/*
CC=${CCOMP} CXX=${CXXCOMP} cmake -DCMAKE_BUILD_TYPE=${BUILDTYPE} -DICHOR_REMOVE_SOURCE_NAMES=0 -DICHOR_ENABLE_INTERNAL_DEBUGGING=${DEBUG} -DICHOR_ENABLE_INTERNAL_IO_DEBUGGING=${IODEBUG} -DICHOR_ARCH_OPTIMIZATION=X86_64_AVX2 -DICHOR_USE_BACKWARD=0 -DICHOR_USE_BOOST_BEAST=${BOOST} -DICHOR_USE_HIREDIS=${HIREDIS} -DICHOR_USE_LIBCPP=0 -DICHOR_USE_SANITIZERS=${ASAN} -DICHOR_USE_THREAD_SANITIZER=${TSAN} -DICHOR_BUILD_TESTING=${RUN_TESTS} -DICHOR_USE_MOLD=${MOLD} -DICHOR_USE_SDEVENT=${SDEVENT} -DICHOR_USE_SPDLOG=${SPDLOG} -DICHOR_USE_LIBURING=${URING} -DICHOR_FORCE_32_BIT=${FORCE_32} ${FORCE_32_TOOLCHAIN} -GNinja .. || exit 1
ninja || exit 1
fi
if [[ $RUN_TESTS -eq 1 ]]; then
ninja test || exit 1
fi
if [[ $RUN_EXAMPLES -eq 1 ]]; then
run_examples $BOOST $URING $SDEVENT
fi
if [[ $RUN_BENCHMARKS -eq 1 ]]; then
run_benchmarks
fi
if command -v checksec --help &> /dev/null
then
checksec --file=../bin/ichor_tcp_example
fi