Bump to ccache 4.4
[platform/upstream/ccache.git] / ci / build
1 #!/bin/sh
2 #
3 # This script is used by CI and build-in-docker.
4
5 set -eu
6
7 if [ -n "${VERBOSE:-}" ]; then
8     set -x
9 fi
10
11 if [ -n "${SPECIAL:-}" ]; then
12     exec "ci/$SPECIAL"
13 else
14     [ -z ${JOBS:+x} ] && JOBS=$(getconf _NPROCESSORS_ONLN 2>/dev/null)
15     [ -z ${JOBS:+x} ] && JOBS=2
16
17     mkdir -p ${BUILDDIR:-build}
18     cd ${BUILDDIR:-build}
19     ${CMAKE_PREFIX:-} cmake ${CMAKE_PARAMS:-} ${CCACHE_LOC:-..}
20     ${CMAKE_PREFIX:-} cmake --build . ${EXTRA_CMAKE_BUILD_FLAGS:-} -- -j$JOBS
21     case "${RUN_TESTS:-all}" in
22         all)
23             CC=${TEST_CC:-${CC}} ctest --output-on-failure -j$JOBS "$@"
24             ;;
25         unittest-in-wine)
26             wine ccache.exe --version
27             wine unittest/unittest.exe
28             ;;
29         none)
30             ;;
31     esac
32 fi