用到的cmake

1. CheckCxxCompilerFlag 模块

检查cxx编译器是否支持某个flag

include(CheckCxxCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++1" COMPILER_SUPPORTS_CXX11)
if (COMPILER_SUPPORTS_CXX11)
    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++1")
else()
    message(FATAL "not support c++11.")
endif()
posted @ 2021-08-16 11:19  suntus  阅读(40)  评论(0编辑  收藏  举报