0

I have one large codebase project in Qt. I have been using two third party libraries: json and QSimpleUpdater. Since, these libraries are external, their source files generates alot of warnings. I can't and don't want to change those external libraries. I want to add different compiler flags for different folders.

For example, source code except external libraries should be compiled with following warnings:

QMAKE_CXXFLAGS += -Wall -Wextra -Wshadow -Wno-unused-parameter

And external libraries should be compiled with:

QMAKE_CXXFLAGS += -Wall

I tried to find answers over stackoverflow and came across this question but that question specify how to add another compiler for the project but i need just to have different warning flags for different files.

abhiarora
  • 9,743
  • 5
  • 32
  • 57
  • this might help: https://stackoverflow.com/questions/5801754/gcc-directory-option-isystem . the `-isystem` basically allows you to select include folders where warnings are ignored – 463035818_is_not_an_ai May 29 '19 at 13:58
  • This is normally done on per-project level. You should consider using a global `SUBDIRS` type of project, along with distinct subprojects for your application and libraries used. – Matt May 30 '19 at 20:04

0 Answers0