Browse Source

Support older compilers with c++0x support but not C++-11

enhancement_3
Trevor Irons 8 years ago
parent
commit
eb9a5bac70
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      CMakeLists.txt

+ 3
- 0
CMakeLists.txt View File

165
 include(CheckCXXCompilerFlag)
165
 include(CheckCXXCompilerFlag)
166
 CHECK_CXX_COMPILER_FLAG(-std=c++14 COMPILER_SUPPORTS_CXX14)
166
 CHECK_CXX_COMPILER_FLAG(-std=c++14 COMPILER_SUPPORTS_CXX14)
167
 CHECK_CXX_COMPILER_FLAG(-std=c++11 COMPILER_SUPPORTS_CXX11)
167
 CHECK_CXX_COMPILER_FLAG(-std=c++11 COMPILER_SUPPORTS_CXX11)
168
+CHECK_CXX_COMPILER_FLAG(-std=c++0x COMPILER_SUPPORTS_CXX0X)
168
 
169
 
169
 if(COMPILER_SUPPORTS_CXX14)
170
 if(COMPILER_SUPPORTS_CXX14)
170
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
171
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
171
 elseif(COMPILER_SUPPORTS_CXX11)
172
 elseif(COMPILER_SUPPORTS_CXX11)
172
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
173
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
174
+elseif(COMPILER_SUPPORTS_CXX0X)
175
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
173
 else()
176
 else()
174
 	message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 or C++14 support. Please use a different C++ compiler.")
177
 	message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 or C++14 support. Please use a different C++ compiler.")
175
 endif()
178
 endif()

Loading…
Cancel
Save