This repository was archived by the owner on Dec 22, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +11
-0
lines changed Expand file tree Collapse file tree 4 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,10 @@ if [[ "${CODE_COVERAGE:-}" == "yes" ]]; then
5858 " -DCMAKE_BUILD_TYPE=Coverage" )
5959fi
6060
61+ if [[ " ${USE_NINJA:- } " == " yes" ]]; then
62+ cmake_flags+=( " -GNinja" )
63+ fi
64+
6165# Avoid unbound variable error with older bash
6266if [[ " ${# cmake_flags[@]} " == 0 ]]; then
6367 cmake " -H${SOURCE_DIR} " " -B${BINARY_DIR} "
Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ elif [[ "${BUILD_NAME}" = "clang-3.8" ]]; then
7878 export DISTRO_VERSION=16.04
7979 export CC=clang
8080 export CXX=clang++
81+ elif [[ " ${BUILD_NAME} " = " ninja" ]]; then
82+ # Compiling with Ninja can catch bugs that may not be caught using Make.
83+ export USE_NINJA=yes
8184else
8285 echo " Unknown BUILD_NAME (${BUILD_NAME} ). Fix the Kokoro .cfg file."
8386 exit 1
@@ -211,6 +214,10 @@ docker_flags=(
211214 # CMake builds use this flag.
212215 " --env" " CODE_COVERAGE=${CODE_COVERAGE:- } "
213216
217+ # If set to 'yes', use Ninja as the CMake generator. Ninja is more strict
218+ # that Make and can detect errors in your CMake files, it is also faster.
219+ " --env" " USE_NINJA=${USE_NINJA:- } "
220+
214221 # If set, pass -DGOOGLE_CLOUD_CPP_CXX_STANDARD=<value> to CMake.
215222 " --env" " GOOGLE_CLOUD_CPP_CXX_STANDARD=${GOOGLE_CLOUD_CPP_CXX_STANDARD:- } "
216223
You can’t perform that action at this time.
0 commit comments