File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ RUN apt update && \
3636 libtool \
3737 lsb-release \
3838 make \
39+ ninja-build \
3940 pkg-config \
4041 python-pip \
4142 shellcheck \
Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ if [[ "${USE_LIBCXX:-}" == "yes" ]]; then
6868 cmake_extra_flags+=( " -DGOOGLE_CLOUD_CPP_USE_LIBCXX=ON" )
6969fi
7070
71+ if [[ " ${USE_NINJA:- } " == " yes" ]]; then
72+ cmake_extra_flags+=( " -GNinja" )
73+ fi
74+
7175# We use parameter expansion for ${cmake_extra_flags} because set -u doesn't
7276# like empty arrays on older versions of Bash (which some of our builds use).
7377# The expression ${parameter+word} will expand word only if parameter is not
Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ elif [[ "${BUILD_NAME}" = "cmake-super" ]]; then
7474 # what spanner does where RUN_INTEGRATION_TESTS is explicitly set to yes.
7575 export RUN_INTEGRATION_TESTS=" no"
7676 in_docker_script=" ci/kokoro/docker/build-in-docker-cmake.sh"
77+ elif [[ " ${BUILD_NAME} " = " ninja" ]]; then
78+ # Compiling with Ninja can catch bugs that may not be caught using Make.
79+ export USE_NINJA=yes
7780elif [[ " ${BUILD_NAME} " = " gcc-9" ]]; then
7881 # Compile under fedora:30. This distro uses gcc-9.
7982 export DISTRO=fedora
@@ -221,6 +224,9 @@ docker_flags=(
221224 # If set, enable using libc++ with CMake.
222225 " --env" " USE_LIBCXX=${USE_LIBCXX:- } "
223226
227+ # If set, enable the Ninja generator with CMake.
228+ " --env" " USE_NINJA=${USE_NINJA:- } "
229+
224230 # If set, use Clang's static analyzer. Currently there is no build that
225231 # uses this feature, it may have rotten.
226232 " --env" " SCAN_BUILD=${SCAN_BUILD:- } "
You can’t perform that action at this time.
0 commit comments