GH-1052 switch over to C++14 everywhere

This commit is contained in:
Petr Mrázek 2015-06-06 19:56:51 +02:00
parent db69a3dacd
commit 678da0b639
3 changed files with 15 additions and 2 deletions

View File

@ -32,7 +32,7 @@ endif()
set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/jars)
######## Set compiler flags ########
include(UseCXX11)
include(UseCXX14)
include(Coverage)
set(CMAKE_CXX_FLAGS " -Wall ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror=return-type")

13
cmake/UseCXX14.cmake Normal file
View File

@ -0,0 +1,13 @@
if(__USECXX14_CMAKE__)
return()
endif()
set(__USECXX14_CMAKE__ TRUE)
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++14")
elseif(UNIX)
# assume GCC, add C++0x/C++11 stuff
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
elseif(MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
endif()

View File

@ -1,6 +1,6 @@
project(libUtil)
include(UseCXX11)
include(UseCXX14)
include(Coverage)
# Find Qt