Skip to content

Commit 46abca3

Browse files
committed
more code shortening
1 parent 2f280f0 commit 46abca3

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

util/buildbot/buildwin64.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ toolchain_file=$topdir/toolchain_${compiler/-gcc/}.cmake
3232
echo "Using $toolchain_file"
3333

3434
# Use ccache if it is available
35-
if command -v ccache >&-; then
36-
extra_args=(-DCMAKE_C_COMPILER_LAUNCHER=ccache \
37-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache)
38-
fi
35+
extra_args=()
36+
command -v ccache >/dev/null && extra_args+=(-DCMAKE_{C,CCX}_COMPILER_LAUNCHER=ccache)
3937

4038
# Try to find runtime DLLs in various paths (varies by distribution, sigh)
4139
tmp=$(dirname "$(command -v $compiler)")/..

util/ci/build.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#! /bin/bash -e
22

33
# Use ccache if it is available
4-
if command -v ccache >&-; then
5-
extra_args=(-DCMAKE_C_COMPILER_LAUNCHER=ccache \
6-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache)
7-
fi
4+
extra_args=()
5+
command -v ccache >/dev/null && extra_args+=(-DCMAKE_{C,CCX}_COMPILER_LAUNCHER=ccache)
86

97
cmake -B build \
108
"${extra_args[@]}" \

util/ci/build_prometheus_cpp.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#! /bin/bash -eu
22

33
# Use ccache if it is available
4-
if command -v ccache >&-; then
5-
extra_args=(-DCMAKE_C_COMPILER_LAUNCHER=ccache \
6-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache)
7-
fi
4+
extra_args=()
5+
command -v ccache >/dev/null && extra_args+=(-DCMAKE_{C,CCX}_COMPILER_LAUNCHER=ccache)
86

97
cd /tmp
108
git clone --recursive https://github.com/jupp0r/prometheus-cpp

0 commit comments

Comments
 (0)