This repository was archived by the owner on Dec 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,11 +64,21 @@ if [[ "${GOOGLE_CLOUD_CPP_CXX_STANDARD:-}" != "" ]]; then
6464 cmake_flags+=(
6565 " -DGOOGLE_CLOUD_CPP_CXX_STANDARD=${GOOGLE_CLOUD_CPP_CXX_STANDARD} " )
6666fi
67+ if [[ " ${USE_NINJA:- } " == " yes" ]]; then
68+ cmake_flags+=( " -GNinja" )
69+ fi
6770
6871# We disable the shellcheck warning because we want ${CMAKE_FLAGS} to expand as
6972# separate arguments.
73+ echo " ================================================================"
74+ echo " Running CMake configuration step $( date) ."
75+ echo " cmake ${CMAKE_FLAGS:- } -H${SOURCE_DIR} -B${BINARY_DIR} " " ${cmake_flags[@]} "
7076# shellcheck disable=SC2086
7177cmake ${CMAKE_FLAGS:- } " -H${SOURCE_DIR} " " -B${BINARY_DIR} " " ${cmake_flags[@]} "
78+
79+ echo " ================================================================"
80+ echo " Running CMake build step $( date) ."
81+ echo " cmake" --build " ${BINARY_DIR} " -- -j " $( nproc) "
7282cmake --build " ${BINARY_DIR} " -- -j " $( nproc) "
7383
7484TEST_JOB_COUNT=" $( nproc) "
Original file line number Diff line number Diff line change @@ -136,6 +136,12 @@ elif [[ "${BUILD_NAME}" = "cmake-super" ]]; then
136136 export BUILD_TYPE=Release
137137 export CMAKE_FLAGS=-DBUILD_SHARED_LIBS=yes
138138 in_docker_script=" ci/kokoro/docker/build-in-docker-cmake.sh"
139+ elif [[ " ${BUILD_NAME} " = " ninja" ]]; then
140+ # Compiling with Ninja can catch bugs that may not be caught using Make.
141+ export USE_NINJA=yes
142+ export CMAKE_SOURCE_DIR=" super"
143+ export CMAKE_FLAGS=-DBUILD_SHARED_LIBS=yes
144+ in_docker_script=" ci/kokoro/docker/build-in-docker-cmake.sh"
139145elif [[ " ${BUILD_NAME} " = " gcc-4.8" ]]; then
140146 # The oldest version of GCC we support is 4.8, this build checks the code
141147 # against that version. The use of CentOS 7 for that build is not a
@@ -298,6 +304,9 @@ docker_flags=(
298304 # Additional flags to enable CMake features.
299305 " --env" " CMAKE_FLAGS=${CMAKE_FLAGS:- } "
300306
307+ # If set, enable the Ninja generator with CMake.
308+ " --env" " USE_NINJA=${USE_NINJA:- } "
309+
301310 # If set, run the check-api.sh script.
302311 " --env" " CHECK_API=${CHECK_API:- } "
303312
You can’t perform that action at this time.
0 commit comments