Skip to content

Commit

Permalink
Require GCC 4.9
Browse files Browse the repository at this point in the history
GCC 4.9 has improved support for C++11; in particular regex support.
  • Loading branch information
micbou committed Apr 9, 2017
1 parent bcc23bd commit 004fcbc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ addons:
packages:
- cmake-data
- cmake
# 4.8.1 is the first version of GCC with full C++11 support.
- g++-4.8
# 4.9 is the first version of GCC with good enough C++11 support; in
# particular regex support.
- g++-4.9
# Required to build the OmniSharp server.
- mono-devel
- ninja-build
Expand Down
8 changes: 4 additions & 4 deletions ci/travis/travis_install.linux.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Linux-specific installation

# We can't use sudo, so we have to approximate the behaviour of the following:
# $ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
# $ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 90

mkdir ${HOME}/bin

ln -s /usr/bin/g++-4.8 ${HOME}/bin/c++
ln -s /usr/bin/gcc-4.8 ${HOME}/bin/cc
ln -s /usr/bin/gcov-4.8 ${HOME}/bin/gcov
ln -s /usr/bin/g++-4.9 ${HOME}/bin/c++
ln -s /usr/bin/gcc-4.9 ${HOME}/bin/cc
ln -s /usr/bin/gcov-4.9 ${HOME}/bin/gcov

export PATH=${HOME}/bin:${PATH}

Expand Down
8 changes: 4 additions & 4 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,17 @@ endif()
# Determining the presence of C++11 support in the compiler
set( CPP11_AVAILABLE false )
if ( CMAKE_COMPILER_IS_GNUCXX )
if ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6 )
if ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9 )
set( CPP11_AVAILABLE true )
endif()
elseif( COMPILER_IS_CLANG )
if ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3 )
if ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3 )
set( CPP11_AVAILABLE true )
set( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11" )
set( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
endif()
elseif( MSVC )
if ( NOT MSVC_VERSION LESS 1800 )
if ( NOT MSVC_VERSION LESS 1800 )
set( CPP11_AVAILABLE true )
endif()
endif()
Expand Down Expand Up @@ -185,7 +185,7 @@ if ( CPP11_AVAILABLE )
add_definitions( -std=c++11 )
endif()
else()
message( FATAL_ERROR "Your C++ compiler does NOT support C++11." )
message( FATAL_ERROR "Your C++ compiler does NOT fully support C++11." )
endif()

# Note: build.py always explicitly sets this option, so the default used here
Expand Down

0 comments on commit 004fcbc

Please sign in to comment.