I have problems with this as well.  I have seen the documentation, it just
doesn't make any sense to me.  I think you are using some terminology in a
way that I am unfamiliar with.  To me, debug and release are mutually
exclusive, much like true and false. In fact, the documentation you point to
specifically states that they are mutually exclusive more than once.  Yet it
also states that the pro file is processed 3 times: debug, release and
debug_and_release.  This seems quite confusing.  Let me guess what is really
happening:

Qmake processes .pro files into Makefiles. The Makefiles may then be used to
build the program.

If just "CONFIG += release" is specified in the .pro file, a Makefile that
only builds a release version is made by qmake.

If just "CONFIG += debug" is specified in the .pro file, a Makefile that
only builds a debug version is made by qmake.

If "CONFIG += debug_and_release" is specified in the .pro file, a
"Makefile.Release" file is produced to make the release version, a
"Makefile.Debug" is produced to make the debug version, and a plain Makefile
is produced which may call either or both of the other Makefiles.

The confusion comes from using the same variable/flags to specify both the
configuration of the Makefiles and how the code is handled by the compiler.
(In the "CONFIG += debug" makefile and the "Makefile.Debug" version, the
"-g" compiler flag is set, otherwise it is not.)  For the compiler, "debug"
and "release" actually are mutually exclusive.  For the Makefiles they are
not.  It would probably be easier to understand if different flags and/or
variables were used for the different uses.

Please let me know if I'm wrong about all this. I think I've finally got it
figured out.

On Mon, Oct 19, 2009 at 12:54 PM, Coda Highland <[email protected]>wrote:

> Using debug: or release: fails to account for BOTH of them appearing
> in the CONFIG variable ("CONFIG += debug release"). CONFIG(release,
> debug|release) will deal with it correctly. This is nothing a simple
> Google search wouldn't have revealed, and in fact it's in the official
> FAQ:
>
> http://qt.nokia.com/developer/faqs/573
>
> /s/ Adam
>
> On Mon, Oct 19, 2009 at 11:29 AM, Danny Price
> <[email protected]> wrote:
> > I really don't get the debug|release thing...
> >
> > On Mon, Oct 19, 2009 at 5:23 PM, Coda Highland <[email protected]>
> > wrote:
> >>
> >> Add something like this to your .pro file:
> >>
> >> CONFIG(release, debug|release): CONFIG += x86 ppc
> >>
> >> /s/ Adam
> >>
> >> On Mon, Oct 19, 2009 at 10:47 AM, Stephen Chu <[email protected]>
> wrote:
> >> > How do I configure a project to create universal binaries only when
> >> > building for release?
> >> >
> >> > I added CONFIG+=x86 ppc in pro file but it build universal binaries in
> >> > both debug and release configurations. It's a waste of time for debug
> >> > build since only one architecture is needed for debugging.
> >> >
> >> > Thanks.
> >> > _______________________________________________
> >> > Qt-creator mailing list
> >> > [email protected]
> >> > http://lists.trolltech.com/mailman/listinfo/qt-creator
> >> >
> >> _______________________________________________
> >> Qt-creator mailing list
> >> [email protected]
> >> http://lists.trolltech.com/mailman/listinfo/qt-creator
> >
> >
> > _______________________________________________
> > Qt-creator mailing list
> > [email protected]
> > http://lists.trolltech.com/mailman/listinfo/qt-creator
> >
> >
> _______________________________________________
> Qt-creator mailing list
> [email protected]
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to