views:

103

answers:

1

Hi,

When I usually work on a C++ project, one of the first things I do is setting up the "treat warning as errors" on my compiler.

When using Qt, qmake generates the Makefile for you and doesn't include this option on the compilation commands. I'm pretty sure there is a way to add such an option (and others) into the generated Makefile but I couldn't figure it out.

How would I do that ?

I'm using the open-source version of Qt with g++ as the compiler.

+2  A: 

You can use QMAKE_CXXFLAGS in pro file to specify compiler flags:

QMAKE_CXXFLAGS += -Werror
Stephen Chu
Many thanks ! ;)
ereOn