1
0
Fork 0

TerraGear now requires the C++14 Standard

This commit is contained in:
Scott Giese 2019-01-20 17:55:08 -06:00
parent de43172716
commit 40e554e1cf
2 changed files with 16 additions and 7 deletions

View file

@ -18,9 +18,9 @@ include (CheckCXXSourceCompiles)
include (CheckIncludeFile)
include (CPack)
# let's use & require C++11 - note these are only functional with CMake 3.1
# let's use & require C++14 - note these are only functional with CMake 3.1
# we do manual fallbacks for CMake 3.0 in the compilers section
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
project(TerraGear)
@ -153,9 +153,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(WARNING_FLAGS -Wall)
if (CMAKE_VERSION VERSION_LESS 3.1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif()
endif(CMAKE_COMPILER_IS_GNUCXX)
elseif (MSVC AND CMAKE_VERSION VERSION_LESS 3.1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std=c++14")
endif()
if (WIN32)
if (MSVC)

View file

@ -188,9 +188,16 @@ unset(SIMGEAR_COMPILE_TEST CACHE)
# disable OSG dependencies for test-compiling
set(CMAKE_REQUIRED_DEFINITIONS "-DNO_OPENSCENEGRAPH_INTERFACE")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if ((NOT CMAKE_CXX_STANDARD) OR (${CMAKE_CXX_STANDARD} LESS 11))
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_VERSION VERSION_LESS 3.1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif (MSVC AND CMAKE_VERSION VERSION_LESS 3.1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std=c++11")
endif()
endif()
check_cxx_source_runs(
"#include <cstdio>