[Qt-interest] different CONFIG+= on debug/release
Gordon Schumacher
gordon at rebit.com
Tue Dec 8 19:13:09 CET 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Israel Brewster wrote:
> Maybe someone can come up with an answer for this one: I want to
> change the config line (in my .pro file) depending on whether I am
> building in release mode or debug mode. This seems like it should
> be straightforward, based on the documentation ( ): just put debug
> { and and release { blocks in my .pro file like so:
>
> deubg { CONFIG += x86_64 }
>
> release { CONFIG += x86 ppc }
>
> The problem I am running into is that it appears that both blocks
> are being run when I compile, regardless of whether I choose a
> debug or release build, as evidenced by the "-arch i386 -arch ppc
> -arch x86_64" string in all the compile lines. The end result is
> that the build fails on linking, as my debug build of Qt doesn't
> have all the architectures due to issues building Qt. It rather
> looks like Qt Creator is trying to build both debug and release
> code (thus defining both) regardless of which I choose, but I don't
> really know. How can I fix this? Thanks.
This is because on a debug_and_release build, both will be set.
What you need is:
CONFIG(debug, debug|release) {
CONFIG += x86_64
}
CONFIG(release, debug|release) {
CONFIG += x86 ppc
}
That will work regardless of whether you're doing a debug_and_release
build or not.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkselzUACgkQ2yRp4mXKHF3AugCeP9VIXfeJk32L6UzvprJGTHIM
RWIAn3oLvPuXxGvXEdCSgNAOHacEcrFl
=G1jQ
-----END PGP SIGNATURE-----
More information about the Qt-interest-old
mailing list