From 11eaad7992d510f9b60a9fbe78df3c39b3daff02 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 11 Mar 2019 14:37:29 -0700 Subject: [PATCH] Fix CI builds --- build.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 3210b4d059..751c96a521 100755 --- a/build.sh +++ b/build.sh @@ -72,6 +72,10 @@ function print_help { echo "" } +# Requirements +CMAKE_MAJOR=3 +CMAKE_MINOR=10 + # Internal variables TARGET=release @@ -492,12 +496,14 @@ function validate_build_command { exit 1 fi - # We allow CI builds to skip CMake version check - if [[ "$SKIP_CMAKE_VERSION_CHECK" != "true" ]]; then + # Only check CMake's version number when building Android binaries + if [[ "$ISSUE_ANDROID_BUILD" == "true" ]]; then cmake_version=`cmake --version` if [[ "$cmake_version" =~ ([0-9]+)\.([0-9]+)\.[0-9]+ ]]; then - if [[ "${BASH_REMATCH[1]}" -lt "3" ]] || [[ "${BASH_REMATCH[2]}" -lt "10" ]]; then - echo "Error: cmake version 3.10+ is required, ${BASH_REMATCH[1]}.${BASH_REMATCH[2]} installed, exiting" + if [[ "${BASH_REMATCH[1]}" -lt "${CMAKE_MAJOR}" ]] || \ + [[ "${BASH_REMATCH[2]}" -lt "${CMAKE_MINOR}" ]]; then + echo "Error: cmake version ${CMAKE_MAJOR}.${CMAKE_MINOR}+ is required," \ + "${BASH_REMATCH[1]}.${BASH_REMATCH[2]} installed, exiting" exit 1 fi fi