需要配置CMAKE_BUILD_TYPE为Debug: if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build Type" FORCE) endif()