简体   繁体   English

CMake:禁止所有警告

[英]CMake: suppress ALL warnings

I am trying to do something extremely simple:我正在尝试做一些非常简单的事情:

I have to work on a C++ project that raises a lot of compilation warnings.我必须处理一个引发大量编译警告的 C++ 项目。 Temporarily, I want to only see errors when I run make.暂时,我只想在运行 make 时看到错误。 What do I need to add to my CMakeLists.txt to make that happen?我需要在我的 CMakeLists.txt 中添加什么来实现这一点? The simpler, the better.越简单越好。

It turns out the answer was to simply add the line事实证明,答案是简单地添加行

add_definitions(-w)

To CMakeLists.txt到 CMakeLists.txt

It took me a lot longer than it should have to find this simple answer.我花了比应该找到这个简单答案的时间更长的时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM