Skip to content

Commit

Permalink
Resolving GCC compiler errors due to constexpr limitation and upgradi…
Browse files Browse the repository at this point in the history
…ng travis scripts.
  • Loading branch information
rparolin committed Dec 6, 2018
1 parent 549400c commit 2c75cf6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 60 deletions.
80 changes: 20 additions & 60 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,87 +16,47 @@ addons:
apt:
sources:
- ubuntu-toolchain-r-test
- george-edison55-precise-backports
- llvm-toolchain-trusty-5.0
packages:
- gcc-6
- g++-6
- clang
- libc++-dev
- cmake
- cmake-data
- g++-7
- clang-5.0

matrix:
include:
- compiler: clang "release build with clang to trigger MOJI check"
env: EASTL_CONFIG=Release USE_MOJI_CHECK=yes
os: linux
- compiler: clang "debug build with clang3.9"
env: EASTL_CONFIG=Debug USE_CLANG_39=yes
os: osx
- compiler: clang "release build with clang3.9"
env: EASTL_CONFIG=Release USE_CLANG_39=yes
os: osx

exclude:
- os: osx
compiler: gcc

install:
# MOJI check; exit 1 if non-ascii characters detected in C++
- if [[ -n "$USE_MOJI_CHECK" && -n `git grep -P "[^[:ascii:]]" source test` ]]; then echo "Moji Detected" && exit 1 ;fi
- if [[ -n "$USE_MOJI_CHECK" ]]; then exit 0 ;fi

# Linux Setup
# CMake
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget --no-check-certificate http://cmake.org/files/v3.1/cmake-3.1.3-Linux-x86_64.tar.gz ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar -xzf cmake-3.1.3-Linux-x86_64.tar.gz ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=$PWD/cmake-3.1.3-Linux-x86_64/bin:$PATH ;fi
# GCC
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" = "g++" ]]; then export CXX="g++-6" CC="gcc-6" ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then which gcc ;fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then gcc --version ;fi

# OSX Setup
# CMake
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget --no-check-certificate http://cmake.org/files/v3.1/cmake-3.1.3-Darwin-x86_64.tar.gz ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tar -xzf cmake-3.1.3-Darwin-x86_64.tar.gz ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH=$PWD/cmake-3.1.3-Darwin-x86_64/CMake.app/Contents/bin:$PATH ;fi
# Clang 3.9
- if [[ "$TRAVIS_OS_NAME" == "osx" && -n "$USE_CLANG_39" ]]; then export CLANG_URL=http://releases.llvm.org/3.9.0/clang+llvm-3.9.0-x86_64-apple-darwin.tar.xz ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && -n "$USE_CLANG_39" ]]; then wget --no-check-certificate $CLANG_URL ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && -n "$USE_CLANG_39" ]]; then tar -xzf clang+llvm-3.9.0-x86_64-apple-darwin.tar.xz ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" && -n "$USE_CLANG_39" ]]; then export CLANG_39_PATH=$(PWD)/clang+llvm-3.9.0-x86_64-apple-darwin/ ;fi
# Homebrew
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then test -d $HOME/.homebrew/bin || git clone https://github.com/Homebrew/brew.git $HOME/.homebrew ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH="$HOME/.homebrew/bin:$PATH" ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then echo 'export PATH="$HOME/.homebrew/bin:$PATH"' >>~/.bash_profile ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export MANPATH="$(brew --prefix)/share/man:$MANPATH" ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export INFOPATH="$(brew --prefix)/share/info:$INFOPATH" ;fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew --version ;fi
- if [[ -n "$USE_MOJI_CHECK" && -n `git grep -P "[^[:ascii:]]" source test` ]]; then echo "Moji Detected" && exit 1 ;fi
- if [[ -n "$USE_MOJI_CHECK" ]]; then exit 0 ;fi
- if [[ "$CXX" == "g++" ]]; then export CC="gcc-7" ;fi
- if [[ "$CXX" == "g++" ]]; then export CXX="g++-7" ;fi

# Universal Setup
before_script:
- if [[ "$CXX" == "clang++" ]]; then export CXXFLAGS="$CXXFLAGS -I${LLVM_ROOT}/install/include -std=c++14 -stdlib=libc++" ;fi
- if [[ "$CXX" == "clang++" ]]; then export LDFLAGS="$LDFLAGS -L${LLVM_ROOT}/install/lib" ;fi
- if [[ -n "$USE_CLANG_39" ]]; then export PATH="${CLANG_39_PATH}/bin:$PATH" ;fi
- if [[ -n "$USE_CLANG_39" ]]; then export CC="clang" ;fi
- if [[ -n "$USE_CLANG_39" ]]; then export CXX="clang++" ;fi
- if [[ -n "$USE_CLANG_39" ]]; then export CXXFLAGS="$CXXFLAGS -I${CLANG_39_PATH}/include -std=c++14 -stdlib=libc++" ;fi
- if [[ -n "$USE_CLANG_39" ]]; then export LDFLAGS="$LDFLAGS -L${CLANG_39_PATH}/lib" ;fi
- mkdir build_$EASTL_CONFIG
- cd build_$EASTL_CONFIG
- cmake .. -DEASTL_BUILD_BENCHMARK:BOOL=ON -DEASTL_BUILD_TESTS:BOOL=ON
- cmake --build . --config $EASTL_CONFIG
- mkdir build_$EASTL_CONFIG
- cd build_$EASTL_CONFIG
- cmake .. -DEASTL_BUILD_BENCHMARK:BOOL=ON -DEASTL_BUILD_TESTS:BOOL=ON
- cmake --build . --config $EASTL_CONFIG

script:
# Run Tests
- cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/test
- ctest -C $EASTL_CONFIG -V || exit 1
- cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/test
- ctest -C $EASTL_CONFIG -V || exit 1

# Run Benchmarks
- cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/benchmark
- ctest -C $EASTL_CONFIG -V || exit 1
- cd $TRAVIS_BUILD_DIR/build_$EASTL_CONFIG/benchmark
- ctest -C $EASTL_CONFIG -V || exit 1

branches:
except:
- gh-pages

cache:
directories:
- $HOME/.linuxbrew/
- $HOME/.homebrew/
3 changes: 3 additions & 0 deletions include/EASTL/internal/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@
#if defined(EA_COMPILER_MSVC_2015)
#define EA_CPP14_CONSTEXPR // not supported
#define EA_NO_CPP14_CONSTEXPR
#elif defined(__GNUC__) && (EA_COMPILER_VERSION < 9000) // Before GCC 9.0
#define EA_CPP14_CONSTEXPR // not supported
#define EA_NO_CPP14_CONSTEXPR
#elif defined(EA_COMPILER_CPP14_ENABLED)
#define EA_CPP14_CONSTEXPR constexpr
#else
Expand Down

0 comments on commit 2c75cf6

Please sign in to comment.