Merge pull request #9509 from zeule/cmake-cxx14

cmake: use C++14 when available
This commit is contained in:
Eugene Shalygin 2018-11-07 14:07:16 +01:00 committed by GitHub
commit 019da6a98c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,13 @@
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_STANDARD "11")
# If C++14 is available, use it as libtorent ABI depends on 11/14 version
if (cxx_std_14 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
message(STATUS "Building in C++14 mode")
set(CMAKE_CXX_STANDARD "14")
else()
message(STATUS "Building in C++11 mode")
set(CMAKE_CXX_STANDARD "11")
endif()
include(MacroQbtCompilerSettings)
qbt_set_compiler_options()