|
| 1 | +#!/bin/bash -eu |
| 2 | +# Copyright 2025 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 | + |
| 18 | +# ===== BUILD Sqlite ===== |
| 19 | +SQLITE_VER=sqlite-autoconf-3480000 |
| 20 | + |
| 21 | +wget https://www.sqlite.org/2025/${SQLITE_VER}.tar.gz |
| 22 | +tar xzf ${SQLITE_VER}.tar.gz |
| 23 | +cd ${SQLITE_VER} |
| 24 | +./configure --enable-static --disable-shared |
| 25 | +make -j"$(nproc)" |
| 26 | +make install |
| 27 | +cd .. |
| 28 | + |
| 29 | +# ===== BUILD zeroMQ ===== |
| 30 | +git clone https://github.com/zeromq/libzmq.git |
| 31 | +cd libzmq |
| 32 | +mkdir build && cd build |
| 33 | +cmake .. -DBUILD_SHARED=OFF -DBUILD_STATIC=ON -DZMQ_BUILD_TESTS=OFF |
| 34 | +make -j"$(nproc)" |
| 35 | +make install |
| 36 | +cd ../.. |
| 37 | + |
| 38 | +# ===== Build BehaviorTree.CPP ===== |
| 39 | +mkdir build && cd build |
| 40 | + |
| 41 | +CMAKE_FLAGS=( |
| 42 | + "-DCMAKE_BUILD_TYPE=Release" |
| 43 | + "-DENABLE_FUZZING=ON" |
| 44 | + "-DFORCE_STATIC_LINKING=ON" |
| 45 | +) |
| 46 | + |
| 47 | +cmake .. "${CMAKE_FLAGS[@]}" |
| 48 | +make -j"$(nproc)" |
| 49 | + |
| 50 | +for fuzzer in bt_fuzzer script_fuzzer bb_fuzzer; do |
| 51 | + cp $fuzzer "$OUT/" |
| 52 | + |
| 53 | + if [ -d ../fuzzing/corpus/${fuzzer} ]; then |
| 54 | + zip -j "$OUT/${fuzzer}_seed_corpus.zip" ../fuzzing/corpus/${fuzzer}/* |
| 55 | + fi |
| 56 | +done |
0 commit comments