about summary refs log tree commit diff
path: root/ci/kokoro/docker/build.sh
diff options
context:
space:
mode:
authorCarlos O'Ryan <coryan@users.noreply.github.com>2019-10-17T18·47-0400
committerGitHub <noreply@github.com>2019-10-17T18·47-0400
commit449df1fd379fecc3f6ec05cc5650651d694e3a53 (patch)
tree264de973bb6a6cfb83cd5cb3e5c3a6d5d9fb7ccd /ci/kokoro/docker/build.sh
parentb6c30c0eee8a8e0a5971ee87f428febe8d256d05 (diff)
ci: add configs for a CMake+Ninja build (#27)
Diffstat (limited to 'ci/kokoro/docker/build.sh')
-rwxr-xr-xci/kokoro/docker/build.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/ci/kokoro/docker/build.sh b/ci/kokoro/docker/build.sh
index 87edff52879e..fbd886f02852 100755
--- a/ci/kokoro/docker/build.sh
+++ b/ci/kokoro/docker/build.sh
@@ -78,6 +78,9 @@ elif [[ "${BUILD_NAME}" = "clang-3.8" ]]; then
   export DISTRO_VERSION=16.04
   export CC=clang
   export CXX=clang++
+elif [[ "${BUILD_NAME}" = "ninja" ]]; then
+  # Compiling with Ninja can catch bugs that may not be caught using Make.
+  export USE_NINJA=yes
 else
   echo "Unknown BUILD_NAME (${BUILD_NAME}). Fix the Kokoro .cfg file."
   exit 1
@@ -211,6 +214,10 @@ docker_flags=(
     # CMake builds use this flag.
     "--env" "CODE_COVERAGE=${CODE_COVERAGE:-}"
 
+    # If set to 'yes', use Ninja as the CMake generator. Ninja is more strict
+    # that Make and can detect errors in your CMake files, it is also faster.
+    "--env" "USE_NINJA=${USE_NINJA:-}"
+
     # If set, pass -DGOOGLE_CLOUD_CPP_CXX_STANDARD=<value> to CMake.
     "--env" "GOOGLE_CLOUD_CPP_CXX_STANDARD=${GOOGLE_CLOUD_CPP_CXX_STANDARD:-}"