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