ci: add configs for a CMake+Ninja build (#27)
This commit is contained in:
parent
b6c30c0eee
commit
449df1fd37
4 changed files with 11 additions and 0 deletions
|
@ -58,6 +58,10 @@ if [[ "${CODE_COVERAGE:-}" == "yes" ]]; then
|
|||
"-DCMAKE_BUILD_TYPE=Coverage")
|
||||
fi
|
||||
|
||||
if [[ "${USE_NINJA:-}" == "yes" ]]; then
|
||||
cmake_flags+=( "-GNinja" )
|
||||
fi
|
||||
|
||||
# Avoid unbound variable error with older bash
|
||||
if [[ "${#cmake_flags[@]}" == 0 ]]; then
|
||||
cmake "-H${SOURCE_DIR}" "-B${BINARY_DIR}"
|
||||
|
|
|
@ -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:-}"
|
||||
|
||||
|
|
0
ci/kokoro/docker/ninja-presubmit.cfg
Normal file
0
ci/kokoro/docker/ninja-presubmit.cfg
Normal file
0
ci/kokoro/docker/ninja.cfg
Normal file
0
ci/kokoro/docker/ninja.cfg
Normal file
Loading…
Reference in a new issue