summaryrefslogtreecommitdiffstats
path: root/src/jaegertracing/opentelemetry-cpp/ci/setup_thrift.sh
blob: 98e14d5e715cd3e7213d7535bf08717836089486 (plain)
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
#!/bin/bash

set -e
export DEBIAN_FRONTEND=noninteractive
export THRIFT_VERSION=0.14.1

install_dir='/usr/local/'
while getopts ":i:" o; do
    case "${o}" in
        i)
            install_dir=${OPTARG}
            ;;
        *)
            ;;
    esac
done

apt update

if ! type cmake > /dev/null; then
    #cmake not installed, exiting
    exit 1
fi
export BUILD_DIR=/tmp/
export INSTALL_DIR=${install_dir}

apt install -y --no-install-recommends \
      libboost-locale-dev \
      libevent-dev \
      libssl-dev \
      ninja-build

if [[ "$1" == "dependencies_only" ]]; then
    exit 0;
fi

pushd $BUILD_DIR
wget https://github.com/apache/thrift/archive/refs/tags/v${THRIFT_VERSION}.tar.gz
tar -zxvf v${THRIFT_VERSION}.tar.gz
cd thrift-${THRIFT_VERSION}
mkdir -p out
pushd out
cmake -G Ninja .. \
    -DBUILD_COMPILER=OFF \
    -DBUILD_CPP=ON \
    -DBUILD_LIBRARIES=ON \
    -DBUILD_NODEJS=OFF \
    -DBUILD_PYTHON=OFF \
    -DBUILD_JAVASCRIPT=OFF \
    -DBUILD_C_GLIB=OFF \
    -DBUILD_JAVA=OFF \
    -DBUILD_TESTING=OFF \
    -DBUILD_TUTORIALS=OFF \
    -DWITH_STDTHREADS=ON \
    -DWITH_BOOSTTHREADS=OFF \
    -DWITH_BOOST_FUNCTIONAL=OFF \
    -DWITH_BOOST_SMART_PTR=OFF \
    -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \
    -DCMAKE_PREFIX_PATH=$INSTALL_DIR \
    ..

ninja -j $(nproc)
ninja install
popd
popd