# 相关链接:https://cmake.org/cmake/help/v3.0/module/CheckCXXCompilerFlag.html
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
    add_definitions("-std=c++11")

endif()


C++代码中则可以如下判断:

#if __cplusplus >= 201103L
#include <random>
#endif // __cplusplus >= 201103L

相关文章:

  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2022-01-31
  • 2021-06-23
  • 2022-12-23
相关资源
相似解决方案