• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash -eu
2# Copyright 2021 Google LLC
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16################################################################################
17
18sed -i 's/git@/https:\/\//g' .gitmodules
19sed -i 's/:taos/\/taos/g' .gitmodules
20sed -i 's/\.git//g' .gitmodules
21
22git submodule update --init --recursive
23sed -i 's/-Werror//g' ./cmake/define.inc
24mkdir debug && cd debug
25cmake .. && cmake --build .
26
27cd build/bin
28
29# Now let's build the fuzzer.
30$CC $CFLAGS -DLINUX -DUSE_LIBICONV -D_LINUX -D_M_X64 \
31     -D_TD_LINUX  -D_TD_LINUX_64 \
32     -I/src/tdengine/src/inc -I/src/tdengine/src/os/inc \
33     -I/src/tdengine/src/util/inc -I/src/tdengine/src/common/inc \
34     -I/src/tdengine/src/tsdb/inc -I/src/tdengine/src/query/inc \
35     -o sql-fuzzer.o -c $SRC/tdengine/tests/fuzz//sql-fuzzer.c
36
37$CC $CFLAGS $LIB_FUZZING_ENGINE sql-fuzzer.o -o $OUT/sql-fuzzer \
38      ../../../debug/src/common/CMakeFiles/common.dir/src/tglobal.c.o  \
39      -Wl,--start-group \
40      ../lib/libtaos_static.a  ../lib/libtrpc.a ../lib/libtutil.a \
41      ../lib/libquery.a  ../lib/libtsdb.a ../lib/libcommon.a \
42       ../lib/libtfs.a ../lib/liblz4.a ../lib/libos.a \
43       ../lib/liboslinux.a ../lib/libz.a ../lib/librmonotonic.a \
44       ../lib/liblua.a \
45       -Wl,--end-group -lpthread -ldl
46
47cp $SRC/*.options $OUT/
48