[Solved] Release mode of qmake is intermittently building in debug mode
-
@qmake.exe unittests.pro -r -spec win32-msvc2010 "CONFIG+=release" "CONFIG+=CodeCoverage"
jom.exe -f Makefile.release@When I ran these build steps from my Qt Creator 5.2.1 I get my unit test application built with debug version intermittently, I mean it is calling my real application UI in debug mode instead of my test application. I think the qmake is always forcing to build my test application in debug mode.
The Makefile.Release for both cases are same, the only difference I see it the sequence of calls for the widgets and UI are different and even the obj files are different.
Could someone suggest the is there any problem with the qmake in 5.2.1 opensource or I have to add arguments to fix this.
Thanks
NK
-
My unittests.pro:
@# unit test linkage
ROOT=$$PWD/../../..
APPS=$$ROOT/apps
EXTERNAL=$$ROOT/externalCUTE_TEST_DIR = $$EXTERNAL/cutetest
debug_and_release {
CONFIG -= debug_and_release
CONFIG += debug_and_release
}
CONFIG(debug, debug|release) {
CONFIG -= debug release
CONFIG += debug
}
CONFIG(release, debug|release) {
CONFIG -= debug release
CONFIG += release
}TEMPLATE = app
TARGET = UnitTestSuite
DESTDIR = ./bin
MOC_DIR = release/.moc
OBJECTS_DIR = ./obj
UI_DIR = ./ui
RCC_DIR = ./rcc
@ -
Hi,
Why all that ?
@
debug_and_release {
CONFIG -= debug_and_release
CONFIG += debug_and_release
}
CONFIG(debug, debug|release) {
CONFIG -= debug release
CONFIG += debug
}
CONFIG(release, debug|release) {
CONFIG -= debug release
CONFIG += release
}@ -
These are all from a .pri file which is include in my .pro, this file is used across all of my projects, so I just copy pasted here for your ref.
@include ($$APPS/setDebugOrRelease.pri)@
This files has these lines,
@debug_and_release {
CONFIG -= debug_and_release
CONFIG += debug_and_release
}
CONFIG(debug, debug|release) {
CONFIG -= debug release
CONFIG += debug
}
CONFIG(release, debug|release) {
CONFIG -= debug release
CONFIG += release
}@ -
!http://oi59.tinypic.com/2s9xi4k.jpg(Makefile.Release_diffs)!
For example:
The diffs in the image shows the Makefile.Release for the unitesttestsuite app (Right) and real app getting called with the Makefile.Release (Left). -
Did you clean up properly after removing the CONFIG related lines ?
-
Thanks for the reply.
I figured out the issue to be in my cutetest.dll which was built in debug and release mode. my unittest app uses cutetest.dll@qmake.exe unittests.pro -r -spec win32-msvc2010 "CONFIG+=release" "CONFIG+=CodeCoverage"
jom.exe -f Makefile.Debug@Same .pro file as mentioned above is creating a Program Debug Database (.pdb) file in my "bin" folder instead of debug version of app.
could you please suggest any directions to figure out what is happening.? -
You explicitly configure for release and then call build on the debug Makefile, that doesn't make sense.
If you want to call either Makefile when you want, just configure for debug and release.
-
Good
Since you have your build working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)