QT_NO_DEBUG_OUTPUT not effective until clean build
Hi,
I have scratching my head - again - over QT_NO_DEBUG_OUTPUT, and finally I managed to pin it down. Here are the steps to reproduce the problem with Sailfish Application SDK 3.0.7:
- Create new project
- Add
#include <QDebug>
in main.cpp - Add
qDebug() << "Debug messages enabled";
tomain()
function - Set the app run in release mode in Sailfish emulator and click the "play" button to run it
- Note that the line is printed, as expected, and close the application
- Add line
DEFINES += QT_NO_DEBUG_OUTPUT
to the project file - Save the file, Qt Creator disables and enables the "play" button as the changed project file is processed
- Click the "play" to run the application again
- Note that the line is still printed, despite the DEFINE, and close the application
- Select
Build > Clean project "name"
from the menu - Click the "play" to run the application again
- Note that the line is no longer printed, as expected
Other way to test this is to wrap qInfo()
inside #ifdef QT_NO_DEBUG_OUTPUT
block, and it too requires cleaning the project before the project files becomes effective.
Now, if instead of QT_NO_DEBUG_OUTPUT
I use a custom string, say NO_BLAH
instead, no clean build is required in order for the #ifdef
block to be effective.
So, it looks to me that QT_NO_DEBUG_OUTPUT
is handled differently and something fishy is going on in that front. I think this qualifies as a bug.
Thanks!
PS. Clean build doesn't solve this question, hence this new question.