]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Tweak ci/build script
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 5 Jul 2020 19:00:47 +0000 (21:00 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 5 Jul 2020 19:07:15 +0000 (21:07 +0200)
- Removed redundant “exit 0” command again.
- Removed now obsolete and misleading comments.
- If JOBS is set to the empty string then detect the number of CPUs instead
  of running a limitless number of jobs.

ci/build

index b326e9a635d0de3d96078d77a068278d0ab7da02..4baeded49689670290d8e848462746c6920b91ef 100755 (executable)
--- a/ci/build
+++ b/ci/build
@@ -11,15 +11,12 @@ fi
 if [ -n "${SPECIAL:-}" ]; then
     exec "ci/$SPECIAL"
 else
-    [ -z ${JOBS+x} ] && JOBS=$(getconf _NPROCESSORS_ONLN 2>/dev/null)
-    [ -z ${JOBS+x} ] && JOBS=2
+    [ -z ${JOBS:+x} ] && JOBS=$(getconf _NPROCESSORS_ONLN 2>/dev/null)
+    [ -z ${JOBS:+x} ] && JOBS=2
 
     mkdir -p ${BUILDDIR:-build}
     cd ${BUILDDIR:-build}
     ${CMAKE_PREFIX:-} cmake ${CMAKE_PARAMS:-} ${CCACHE_LOC:-..}
-    # 4 jobs seem to be a reasonable default for Travis.
-    ${CMAKE_PREFIX:-} cmake --build . ${BUILDEXTRAFLAGS:-} -- -j${JOBS}
-    # Warning: Rare random failures when running with -j4.
-    [ "${RUN_TESTS:-1}" -ne "1" ] || ctest --output-on-failure -j${JOBS} "$@"
+    ${CMAKE_PREFIX:-} cmake --build . ${BUILDEXTRAFLAGS:-} -- -j$JOBS
+    [ "${RUN_TESTS:-1}" -ne "1" ] || ctest --output-on-failure -j$JOBS "$@"
 fi
-exit 0