浏览代码

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

enhancement_3
Trevor Irons 8 年前
父节点
当前提交
eb9a5bac70
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3
    0
      CMakeLists.txt

+ 3
- 0
CMakeLists.txt 查看文件

@@ -165,11 +165,14 @@ endif()
165 165
 include(CheckCXXCompilerFlag)
166 166
 CHECK_CXX_COMPILER_FLAG(-std=c++14 COMPILER_SUPPORTS_CXX14)
167 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 170
 if(COMPILER_SUPPORTS_CXX14)
170 171
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
171 172
 elseif(COMPILER_SUPPORTS_CXX11)
172 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 176
 else()
174 177
 	message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 or C++14 support. Please use a different C++ compiler.")
175 178
 endif()

正在加载...
取消
保存