[Qt-creator] OS X: Universal binaries only in Release build?

Daniel Grubbs dgrubbs at dexrex.com
Tue Oct 20 00:17:10 CEST 2009


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 <coda at bobandgeorge.com>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
> <deepblue842 at googlemail.com> wrote:
> > I really don't get the debug|release thing...
> >
> > On Mon, Oct 19, 2009 at 5:23 PM, Coda Highland <coda at bobandgeorge.com>
> > 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 <stephen at ju-ju.com>
> 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
> >> > Qt-creator at trolltech.com
> >> > http://lists.trolltech.com/mailman/listinfo/qt-creator
> >> >
> >> _______________________________________________
> >> Qt-creator mailing list
> >> Qt-creator at trolltech.com
> >> http://lists.trolltech.com/mailman/listinfo/qt-creator
> >
> >
> > _______________________________________________
> > Qt-creator mailing list
> > Qt-creator at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-creator
> >
> >
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20091019/5599888a/attachment.html 


More information about the Qt-creator-old mailing list