mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-02-08 10:46:52 +08:00
travis vs FetchContent_MakeAvailable(): give up on a recent cmake
... Avoid using the modern cmake function, and go back to an earlier approach. The ppc64le travis images was not dealing well with the attempt to hoist a modern cmake into it: https://travis-ci.com/github/lemire/fast_float/jobs/444278392
This commit is contained in:
parent
ed6664d93e
commit
8ba7d2e850
119
.travis.yml
119
.travis.yml
@ -2,11 +2,6 @@ language: cpp
|
|||||||
|
|
||||||
dist: bionic
|
dist: bionic
|
||||||
|
|
||||||
arch:
|
|
||||||
- amd64
|
|
||||||
- ppc64le
|
|
||||||
- s390x
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.dep_cache
|
- $HOME/.dep_cache
|
||||||
@ -15,9 +10,30 @@ env:
|
|||||||
global:
|
global:
|
||||||
- fastfloat_DEPENDENCY_CACHE_DIR=$HOME/.dep_cache
|
- fastfloat_DEPENDENCY_CACHE_DIR=$HOME/.dep_cache
|
||||||
|
|
||||||
|
|
||||||
|
# the ppc64le and s390x images use cmake 3.10, but fast_float requires 3.11.
|
||||||
|
# so we compile cmake from source in those images.
|
||||||
|
# - tried the kitware ppa but that is using 3.10 as well
|
||||||
|
# - tried also using snap to get a more recent version but that failed with
|
||||||
|
# udev errors.
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: linux
|
- arch: ppc64le
|
||||||
|
os: linux
|
||||||
|
env:
|
||||||
|
- CMAKE_SRC="https://github.com/Kitware/CMake/releases/download/v3.11.4/cmake-3.11.4.tar.gz"
|
||||||
|
|
||||||
|
- arch: s390x
|
||||||
|
os: linux
|
||||||
|
env:
|
||||||
|
- CMAKE_SRC="https://github.com/Kitware/CMake/releases/download/v3.11.4/cmake-3.11.4.tar.gz"
|
||||||
|
|
||||||
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
|
|
||||||
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
@ -28,7 +44,8 @@ matrix:
|
|||||||
- COMPILER="CC=gcc-8 && CXX=g++-8"
|
- COMPILER="CC=gcc-8 && CXX=g++-8"
|
||||||
compiler: gcc-8
|
compiler: gcc-8
|
||||||
|
|
||||||
- os: linux
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
@ -39,7 +56,8 @@ matrix:
|
|||||||
- COMPILER="CC=gcc-9 && CXX=g++-9"
|
- COMPILER="CC=gcc-9 && CXX=g++-9"
|
||||||
compiler: gcc-9
|
compiler: gcc-9
|
||||||
|
|
||||||
- os: linux
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
@ -50,7 +68,8 @@ matrix:
|
|||||||
- COMPILER="CC=gcc-10 && CXX=g++-10"
|
- COMPILER="CC=gcc-10 && CXX=g++-10"
|
||||||
compiler: gcc-10
|
compiler: gcc-10
|
||||||
|
|
||||||
- os: linux
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
@ -62,7 +81,8 @@ matrix:
|
|||||||
- SANITIZE="on"
|
- SANITIZE="on"
|
||||||
compiler: gcc-10-sanitize
|
compiler: gcc-10-sanitize
|
||||||
|
|
||||||
- os: linux
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
@ -72,9 +92,10 @@ matrix:
|
|||||||
env:
|
env:
|
||||||
- COMPILER="CC=gcc-10 && CXX=g++-10"
|
- COMPILER="CC=gcc-10 && CXX=g++-10"
|
||||||
- STATIC="on"
|
- STATIC="on"
|
||||||
compiler: gcc-10-static
|
acompiler: gcc-10-static
|
||||||
|
|
||||||
- os: linux
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
@ -85,7 +106,8 @@ matrix:
|
|||||||
- COMPILER="CC=clang-6.0 && CXX=clang++-6.0"
|
- COMPILER="CC=clang-6.0 && CXX=clang++-6.0"
|
||||||
compiler: clang-6
|
compiler: clang-6
|
||||||
|
|
||||||
- os: linux
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
@ -96,7 +118,8 @@ matrix:
|
|||||||
- COMPILER="CC=clang-7 && CXX=clang++-7"
|
- COMPILER="CC=clang-7 && CXX=clang++-7"
|
||||||
compiler: clang-7
|
compiler: clang-7
|
||||||
|
|
||||||
- os: linux
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
@ -107,7 +130,8 @@ matrix:
|
|||||||
- COMPILER="CC=clang-8 && CXX=clang++-8"
|
- COMPILER="CC=clang-8 && CXX=clang++-8"
|
||||||
compiler: clang-8
|
compiler: clang-8
|
||||||
|
|
||||||
- os: linux
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
@ -118,7 +142,8 @@ matrix:
|
|||||||
- COMPILER="CC=clang-9 && CXX=clang++-9"
|
- COMPILER="CC=clang-9 && CXX=clang++-9"
|
||||||
compiler: clang-9
|
compiler: clang-9
|
||||||
|
|
||||||
- os: linux
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@ -131,7 +156,8 @@ matrix:
|
|||||||
- COMPILER="CC=clang-10 && CXX=clang++-10"
|
- COMPILER="CC=clang-10 && CXX=clang++-10"
|
||||||
compiler: clang-10
|
compiler: clang-10
|
||||||
|
|
||||||
- os: linux
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@ -145,7 +171,8 @@ matrix:
|
|||||||
- STATIC="on"
|
- STATIC="on"
|
||||||
compiler: clang-10-static
|
compiler: clang-10-static
|
||||||
|
|
||||||
- os: linux
|
- arch: amd64
|
||||||
|
os: linux
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@ -163,42 +190,36 @@ before_install:
|
|||||||
- eval "${COMPILER}"
|
- eval "${COMPILER}"
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# make sure we have a recent cmake version.
|
- |
|
||||||
# fastfloat itself does not require it, but the tests require >= 3.14.
|
if [ "$CMAKE_SRC" != "" ] ; then
|
||||||
|
set -x
|
||||||
# these architectures have a snap:
|
set -e
|
||||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/20122
|
sudo -E apt remove --purge cmake
|
||||||
- sudo -E apt-get -y update
|
sudo -E apt-get update
|
||||||
- sudo -E apt-get -y install snapd
|
sudo -E apt-get install -y build-essential libssl-dev
|
||||||
- sudo -E snap install cmake --beta --classic
|
mkdir cmake_src
|
||||||
- export PATH=/snap/cmake/current/bin:$PATH
|
pushd cmake_src
|
||||||
|
wget "$CMAKE_SRC"
|
||||||
# ALTERNATIVE: does not work on s390 and ppc64le
|
tar xfz $(basename "$CMAKE_SRC")
|
||||||
## https://github.com/kahypar/kahypar/blob/master/.travis.yml
|
pushd $(basename "$CMAKE_SRC" | sed "s:.tar.gz::")
|
||||||
#- echo ${TRAVIS_OS_NAME}
|
./bootstrap
|
||||||
#- |
|
make -j2
|
||||||
# if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
|
sudo make install
|
||||||
# pwd ;
|
popd
|
||||||
# export DEPS_DIR="${HOME}/deps" ;
|
popd
|
||||||
# mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR} ;
|
set +x
|
||||||
# export CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0-Linux-x86_64.tar.gz";
|
fi
|
||||||
# mkdir cmake;
|
|
||||||
# travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake;
|
|
||||||
# export PATH=${DEPS_DIR}/cmake/bin:${PATH};
|
|
||||||
# cd - ;
|
|
||||||
# pwd
|
|
||||||
# else
|
|
||||||
# brew install cmake || brew upgrade cmake;
|
|
||||||
# fi
|
|
||||||
|
|
||||||
- echo ${PATH}
|
- echo ${PATH}
|
||||||
- which cmake
|
- which cmake
|
||||||
- cmake --version
|
- cmake --version
|
||||||
|
- which ${CC}
|
||||||
|
- ${CC} --version
|
||||||
|
- which ${CXX}
|
||||||
|
- ${CXX} --version
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- mkdir build
|
- mkdir build
|
||||||
- cd build
|
- cd build
|
||||||
- cmake -DFASTFLOAT_TEST=ON ..
|
- cmake -DFASTFLOAT_TEST=ON ..
|
||||||
- make
|
- make -j2
|
||||||
- ctest --output-on-failure -R basictest
|
- ctest --output-on-failure -R basictest
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.11)
|
cmake_minimum_required(VERSION 3.9)
|
||||||
|
|
||||||
project(fast_float VERSION 0.1.0 LANGUAGES CXX)
|
project(fast_float VERSION 0.1.0 LANGUAGES CXX)
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
|||||||
@ -1,13 +1,22 @@
|
|||||||
# FetchContent_MakeAvailable() was only introduced in 3.14
|
# FetchContent requires cmake >=3.11
|
||||||
# https://cmake.org/cmake/help/v3.14/release/3.14.html#modules
|
# see https://cmake.org/cmake/help/v3.11/module/FetchContent.html
|
||||||
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
|
||||||
|
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
FetchContent_Declare(doctest
|
FetchContent_Declare(doctest
|
||||||
GIT_REPOSITORY https://github.com/onqtam/doctest.git
|
GIT_REPOSITORY https://github.com/onqtam/doctest.git
|
||||||
GIT_TAG master)
|
GIT_TAG 2.4.1)
|
||||||
FetchContent_MakeAvailable(doctest)
|
|
||||||
|
# FetchContent_MakeAvailable() was only introduced in 3.14
|
||||||
|
# https://cmake.org/cmake/help/v3.14/release/3.14.html#modules
|
||||||
|
# FetchContent_MakeAvailable(doctest)
|
||||||
|
FetchContent_GetProperties(doctest)
|
||||||
|
if(NOT doctest_POPULATED)
|
||||||
|
FetchContent_Populate(doctest)
|
||||||
|
add_subdirectory(${doctest_SOURCE_DIR} ${doctest_BINARY_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
function(fast_float_add_cpp_test TEST_NAME)
|
function(fast_float_add_cpp_test TEST_NAME)
|
||||||
add_executable(${TEST_NAME} ${TEST_NAME}.cpp)
|
add_executable(${TEST_NAME} ${TEST_NAME}.cpp)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user