Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Configuring Qt, what replaces -debug-and-release?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 8.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aija8saksss
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aija8saksss
        wrote on last edited by aija8saksss
        #3

        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.

        kshegunovK 1 Reply Last reply
        0
        • A aija8saksss

          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.

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by kshegunov
          #4

          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.

          Read and abide by the Qt Code of Conduct

          A 1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            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.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • kshegunovK kshegunov

              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.

              A Offline
              A Offline
              aija8saksss
              wrote on last edited by aija8saksss
              #6

              @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.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                aija8saksss
                wrote on last edited by
                #7

                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.
                1 Reply Last reply
                3

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved