Enable compiler warnings in Kdevelop

折月煮酒 提交于 2020-01-05 07:36:50

问题


I'm using Kdevelop for a simple C++ project. I know that Kdevelop uses CMake to build the project, but the only thing that I known about CMake is that if I add a new .cpp source file in my project, I have to add it also in CMakeLists.txt.

Now I'm trying to enable tha gcc compiler warnings (i.e. compiling with g++ -Wall ...).

Does Kdevelop have a compiler settings section, or I have to edit directly the Makefile or another CMake settings file?


回答1:


You can add compiler flags in CMake by adding the following command to your CMakeLists.txt:

list( APPEND CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")


来源:https://stackoverflow.com/questions/14894852/enable-compiler-warnings-in-kdevelop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!