[question] How to disable warnings from headers from dependencies
See original GitHub issueI am using some dependency packages in my project and their headers generate a lot of warnings when compiling with my code.
Is there a way to mark the dependencies’ headers as system headers similar to gcc’s -isystem flag? So that the warnings will be ignored.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to suppress GCC warnings from library headers?
I have a project that uses log4cxx, boost, etc. libraries whose headers generate lots of (repetitive) warnings. Is there a way to suppress...
Read more >How can I suppress warnings for external headers in VS2017 ...
I want to use the Code Analysis in Visual Studio 2017. This is NOT A BUILD - I'm going to Analyze->Run Code Analysis->On...
Read more >[Solved]-MSVC - stop warnings in headers-C++
You can disable specific warnings using the /wdXXXX flag where XXXX is the number of the warnings you wish to ignore. No need...
Read more >Preprocessor Options - GCC, the GNU Compiler Collection
Make all warnings into hard errors. Source code which triggers warnings will be rejected. -Wsystem-headers: Issue warnings for code in system headers. These...
Read more >Customized Warning Levels and Code Analysis for External ...
Set the warning level, code analysis, and other settings for external header in the. Customizing Code Analysis Settings for External Headers.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Ah, yes, the lack of docs is a problem. here’s this.
https://github.com/conan-io/docs/issues/601
So, I guess that the easiest thing that you might be able to do is mentioned here by @uilianries
https://github.com/bincrafters/community/issues/1100#issuecomment-604997132
set(CONAN_SYSTEM_INCLUDES ON)But, I think the issue with this is that it only works for globals. If you’re using Conan via
find_packageand targets , I don’t think it works. Is that right @uilianries ?Hi @kakashidinho that’s first time I see it. Actually, the default behavior for me, when using Conan, is with -isystem for cmake generator. As example, let’s use gtest recipe when building its test package:
As you can see,
CONAN_SYSTEM_INCLUDEis not enabled, but still Conan uses-isystemfor GTest include folder. I have no sure how, but my guess some other flags affect CMake behavior.