Configuring Qt, what replaces -debug-and-release?



  • In the past we've always configured Qt with -debug-and-release when building for Windows and Linux. We're now migrating to 5.6.2 and we see this warning from configure:

    WARNING: -debug-and-release is not supported outside of Mac OS X.
    Qt can be built in release mode with separate debug information, so
    -debug-and-release is not necessary anymore

    And indeed, ./configure --help now says that -debug-and-release only works for Mac

    How then does one create a kit that has both debug and release builds of Qt? What is the new & correct way of saying "-debug-and-release" when configuring Qt? I see the -force-debug-info option but we do not want debug symbols in the release build.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    AFAI; currently you would create two out of source builds, one for release and one for debug. This way, you ensure clean separated builds.

    Hope it helps



  • Hi, and thanks.

    You aren't meant to switch kits just to switch between building your app in release or debug. The purpose of -debug-and-release is to produce a kit that has both and enables you to switch build config, just like the prebuilt kits.

    On further investigation it looks like this is something that broke and was partially repaired/reimplemented in later versions. 5.6 says -debug-and-release will only work for Mac, but 5.8 says it will work for Apple and Windows (again, as it used to prior to 5.6).

    Creating separate 5.6 kits for debug and release wouldn't be the end of the world but neither is it ideal to build the thing twice and switch kits rather than simply switching build between debug and release as you're supposed to.

    I'm curious how the built-in kits for 5.6 are debug-and-release when that configure option isn't available to us. Is it possible to build R and D separately with the same install prefix? Will that create a mess or will it create a proper kit? Given the build time I'd rather ask before experimenting.


  • Qt Champions 2016

    You can configure one build configuration per kit - one debug config for your debug kit and one release configuration for the release kit. Switching between them is then a matter of a single click.

    I'm curious how the built-in kits for 5.6 are debug-and-release when that configure option isn't available to us.

    You don't need Qt's debug symbols to configure your application in debug mode, although I have no idea what built-in kits you refer to.

    Is it possible to build R and D separately with the same install prefix?

    I'd say "no" to that, but I haven't tried it, so I'm only speculating here.


  • Lifetime Qt Champion

    I don't have a Win machine at hand to try but in any case, you don't need to build the full Qt to test that. You can build a small version of the qtbase module.



  • @kshegunov

    "although I have no idea what built-in kits you refer to."

    When you install Qt it comes with prebuilt kits, e.g "Desktop Qt 5.6.0 MSVC 2013 32bit". These kits that are built-in with an installation of Qt are what I refer to as built-in kits.

    Now if you examine such a kit, meaning you go and look at the files comprising that kit, you will find that it contains both a release and a debug build in the same location. The debug and release builds of the Qt binaries in that kit reside in the same folder: Qt5Bluetooth.dll and Qt5Bluetoothd.dll (for example) are not in separate locations, but the same location. Same goes for all the others, the plugins, and so on. Thus the "single click" in question is the click where one selects Debug or Release within the confines of the same kit. One configures a project with one kit that has both. One does not need to configure a project with multiple kits just to have both debug and release.

    Now, when building Qt from source, this is precisely what is produced by the configuration setting -debug-and-release. It produces a kit that contains both D and R; one prefix, one folder, two configurations, just like the built-in kits.

    That is what we're talking about here. That is the subject of this thread.

    You don't need Qt's debug symbols to configure your application in debug mode

    It is necessary for us to modify the Qt source, hence the reason we are building our own kits. If not for that we would simply use the built-in kits.

    Up until now we've been building our kits the same way the built-in kits come to us: R and D in one install prefix, as described above (and as visible to you on your own hard drive). Now for some reason, 5.6 removes the ability to build Qt in this way (except, as we've noted already, for Apple). 5.8 -- or possibly 5.7 but I haven't checked -- has repaired/restored the ability to build this way for Windows.

    As we cannot migrate to 5.8 and are instead constrained to 5.6, the purpose of this thread is to ascertain how one is meant to produce a proper kit, i.e one containing both debug and release, just like the ones Qt ships, just like the ones we've built up until 5.6 -- in the absence of the -debug-and-release configuration feature. As I pointed out, the built-in 5.6 kits are still packaged in this way so it must be possible.



  • For anyone who's in the same boat, it turns out you can still make a proper kit for Windows in 5.6, even without the -debug-and-release switch working properly.

    • Shadow-build debug and release into their own build folders but with the same install prefix.
    • Install debug first then release, so that the utility binaries in the kit like QtWebengineProcess.exe end up as the release versions.
    • Profit. No reason to do something as absurd as switch kits just to switch between debug & release builds.

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.