diff options
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rwxr-xr-x | ci/before_install.sh | 13 |
3 files changed, 16 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml index 18ab33e802..90570637ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,6 +80,8 @@ jobs: compiler: gcc env: - BUILD_32BIT=ON + # Minimum required CMake. + - CMAKE_URL=https://cmake.org/files/v2.8/cmake-2.8.12-Linux-i386.sh - *common-job-env - if: branch = master AND commit_message !~ /\[skip.lint\]/ name: lint diff --git a/CMakeLists.txt b/CMakeLists.txt index af526ed72d..1a1ad9cf12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ # intro: https://codingnest.com/basic-cmake/ # best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1 +# Version should match the tested CMAKE_URL in .travis.yml. cmake_minimum_required(VERSION 2.8.12) project(nvim C) diff --git a/ci/before_install.sh b/ci/before_install.sh index ff2abc0e12..774c66d38f 100755 --- a/ci/before_install.sh +++ b/ci/before_install.sh @@ -46,3 +46,16 @@ fi source ~/.nvm/nvm.sh nvm install --lts nvm use --lts + +if [[ -n "$CMAKE_URL" ]]; then + echo "Installing custom CMake: $CMAKE_URL" + curl --retry 5 --silent --fail -o /tmp/cmake-installer.sh "$CMAKE_URL" + mkdir -p "$HOME/.local/bin" /opt/cmake-custom + bash /tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license + ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake" + cmake_version="$(cmake --version)" + echo "$cmake_version" | grep -qF '2.8.12' || { + echo "Unexpected CMake version: $cmake_version" + exit 1 + } +fi |