Skip to content

Commit

Permalink
Use C++14 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
tm604 committed Sep 12, 2015
1 parent ef5f2cf commit ab5de73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(USE_CLANG)
set(CMAKE_CXX_COMPILER "/usr/bin/clang++-3.7")
endif()
include(set_cxx_norm.cmake)
set_cxx_norm(${CXX_NORM_CXX11})
set_cxx_norm(${CXX_NORM_CXX14})
enable_testing()

set(Protocols_LIBRARY asio-protocols)
Expand Down
9 changes: 9 additions & 0 deletions set_cxx_norm.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 2.6.3)
set(CXX_NORM_CXX98 1) # C++98
set(CXX_NORM_CXX03 2) # C++03
set(CXX_NORM_CXX11 3) # C++11
set(CXX_NORM_CXX14 4) # C++14

# - Set the wanted C++ norm
# Adds the good argument to the command line in function of the compiler
Expand Down Expand Up @@ -41,12 +42,20 @@ macro(set_cxx_norm NORM)
else()
add_definitions("-std=c++11")
endif()
elseif(${NORM} EQUAL ${CXX_NORM_CXX14})
if(${cxx_compiler_version} VERSION_LESS "4.9.0")
add_definitions("-std=c++1y")
else()
add_definitions("-std=c++14")
endif()
endif()

elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")

if(${NORM} EQUAL ${CXX_NORM_CXX11})
add_definitions("-std=c++11")
elseif(${NORM} EQUAL ${CXX_NORM_CXX14})
add_definitions("-std=c++14")
endif()

endif()
Expand Down

0 comments on commit ab5de73

Please sign in to comment.