CMake C++11设置

    科技2025-01-26  4

    if(CMAKE_VERSION VERSION_LESS 3.0.0) include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-std=c++11 COMPILER_SUPPORTS_CXX11) check_cxx_compiler_flag(-std=c++0x COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") elseif(COMPILER_SUPPORTS_CXX0X) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") endif() else() SET(CMAKE_CXX_STANDARD 11) SET(CMAKE_CXX_STANDARD_REQUIRED ON) endif()
    Processed: 0.010, SQL: 8