Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditionally disable warnings with qmake/gcc?

I am involved with a software project written in Qt and built with qmake and gcc on Linux. We have to link to a third-party library that is of fairly low quality and spews tons of warnings. I would like to use -W -Wall on our source code, but pass -w to the nasty third-party library to keep the console free of noise and clutter so we can focus on our code quality.

In qmake, is there a way to conditionally add CFLAGS/CXXFLAGS to certain files and libraries?

like image 822
Kevin Bowling Avatar asked Apr 22 '09 05:04

Kevin Bowling


1 Answers

Jonathan, I think the problem is where your source files are including header files from 3rd party libraries, and you want to switch off the warnings for the latter.

Kevin, i think you can use pragmas to control warnings : gcc diagnostic pragmas

You could add these before and after any #includes for 3rd party libs.

like image 197
jon-hanson Avatar answered Sep 17 '22 18:09

jon-hanson