diff --git a/util/buildbot/buildwin32.sh b/util/buildbot/buildwin32.sh index c931d1d0fe286..33dda18615d6f 100755 --- a/util/buildbot/buildwin32.sh +++ b/util/buildbot/buildwin32.sh @@ -26,10 +26,6 @@ fi toolchain_file=$topdir/toolchain_${compiler/-gcc/}.cmake echo "Using $toolchain_file" -# Use ccache if it is available -extra_args=() -command -v ccache >/dev/null && extra_args+=(-DCMAKE_{C,CCX}_COMPILER_LAUNCHER=ccache) - find_runtime_dlls i686-w64-mingw32 # Get stuff @@ -64,7 +60,6 @@ cd $builddir [ -d build ] && rm -rf build cmake_args=( - "${extra_args[@]}" -DCMAKE_TOOLCHAIN_FILE=$toolchain_file -DCMAKE_INSTALL_PREFIX=/tmp -DVERSION_EXTRA=$git_hash @@ -76,6 +71,8 @@ cmake_args=( -DENABLE_GETTEXT=1 -DENABLE_LEVELDB=1 ) +# Use ccache if it is available +command -v ccache >/dev/null && cmake_args+=(-DCMAKE_{C,CCX}_COMPILER_LAUNCHER=ccache) add_cmake_libs cmake -S $sourcedir -B build "${cmake_args[@]}" diff --git a/util/buildbot/buildwin64.sh b/util/buildbot/buildwin64.sh index 7bd5fd0c9f6f0..6fb25ce29feb9 100755 --- a/util/buildbot/buildwin64.sh +++ b/util/buildbot/buildwin64.sh @@ -26,12 +26,6 @@ fi toolchain_file=$topdir/toolchain_${compiler/-gcc/}.cmake echo "Using $toolchain_file" -# Use ccache if it is available -if command -v ccache >&-; then - extra_args=(-DCMAKE_C_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache) -fi - find_runtime_dlls x86_64-w64-mingw32 # Get stuff @@ -63,7 +57,6 @@ cd $sourcedir [ -d build ] && rm -rf build cmake_args=( - "${extra_args[@]}" -DCMAKE_TOOLCHAIN_FILE=$toolchain_file -DCMAKE_INSTALL_PREFIX=/tmp -DVERSION_EXTRA=$git_hash @@ -75,6 +68,8 @@ cmake_args=( -DENABLE_GETTEXT=1 -DENABLE_LEVELDB=1 ) +# Use ccache if it is available +command -v ccache >/dev/null && cmake_args+=(-DCMAKE_{C,CCX}_COMPILER_LAUNCHER=ccache) add_cmake_libs cmake -S $sourcedir -B build "${cmake_args[@]}" diff --git a/util/ci/build.sh b/util/ci/build.sh index 4c6ba8cad2e6d..f7a3da5e28b57 100755 --- a/util/ci/build.sh +++ b/util/ci/build.sh @@ -1,10 +1,8 @@ #! /bin/bash -e # Use ccache if it is available -if command -v ccache >&-; then - extra_args=(-DCMAKE_C_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache) -fi +extra_args=() +command -v ccache >/dev/null && extra_args+=(-DCMAKE_{C,CCX}_COMPILER_LAUNCHER=ccache) cmake -B build \ "${extra_args[@]}" \ diff --git a/util/ci/build_prometheus_cpp.sh b/util/ci/build_prometheus_cpp.sh index cc650ca4f22a2..144fb197f5e2c 100755 --- a/util/ci/build_prometheus_cpp.sh +++ b/util/ci/build_prometheus_cpp.sh @@ -1,10 +1,8 @@ #! /bin/bash -eu # Use ccache if it is available -if command -v ccache >&-; then - extra_args=(-DCMAKE_C_COMPILER_LAUNCHER=ccache \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache) -fi +extra_args=() +command -v ccache >/dev/null && extra_args+=(-DCMAKE_{C,CCX}_COMPILER_LAUNCHER=ccache) cd /tmp git clone --recursive https://github.com/jupp0r/prometheus-cpp