blob: df5c570f3e939d8f65f4339091f13cee8a26cf34 [file] [log] [blame]
Alok Bhattadb03672020-10-24 14:24:53 +00001#!/bin/sh
2
3echo "---> cmake-sonarqube.sh starts"
4
5CMAKE_OPTS=
6BUILD_DIR=$WORKSPACE/src
7BUILD_WRAP_DIR=$WORKSPACE/bw-output
8
9
10build_dir="${BUILD_DIR:-$WORKSPACE/build}"
11build_wrap_dir="${BUILD_WRAP_DIR:-$WORKSPACE/bw-output}"
12cmake_opts="${CMAKE_OPTS:-}"
13make_opts="${MAKE_OPTS:-}"
14
15cd src || exit 1
16wget -q -O bw.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
17unzip -q bw.zip
18sudo mv build-wrapper-* /opt/build-wrapper
19
20mkdir -p "$build_dir"
21cd "$build_dir" || exit 1
22
23
24# $make_opts may be empty.
25# shellcheck disable=SC2086
26/opt/build-wrapper/build-wrapper-linux-x86-64 --out-dir "$build_wrap_dir" make $make_opts
27
28echo "---> cmake-sonarqube.sh ends"