Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Release mode of qmake is intermittently building in debug mode
Qt 6.12 LTS is out! See what's new in the release blog

[Solved] Release mode of qmake is intermittently building in debug mode

Scheduled Pinned Locked Moved General and Desktop
11 Posts 2 Posters 6.0k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #2

    My unittests.pro:

    @# unit test linkage
    ROOT=$$PWD/../../..
    APPS=$$ROOT/apps
    EXTERNAL=$$ROOT/external

    CUTE_TEST_DIR = $$EXTERNAL/cutetest

    debug_and_release {
    CONFIG -= debug_and_release
    CONFIG += debug_and_release
    }
    CONFIG(debug, debug|release) {
    CONFIG -= debug release
    CONFIG += debug
    }
    CONFIG(release, debug|release) {
    CONFIG -= debug release
    CONFIG += release
    }

    TEMPLATE = app
    TARGET = UnitTestSuite
    DESTDIR = ./bin
    MOC_DIR = release/.moc
    OBJECTS_DIR = ./obj
    UI_DIR = ./ui
    RCC_DIR = ./rcc
    @

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

      Hi,

      Why all that ?

      @
      debug_and_release {
      CONFIG -= debug_and_release
      CONFIG += debug_and_release
      }
      CONFIG(debug, debug|release) {
      CONFIG -= debug release
      CONFIG += debug
      }
      CONFIG(release, debug|release) {
      CONFIG -= debug release
      CONFIG += release
      }@

      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
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #4

        These are all from a .pri file which is include in my .pro, this file is used across all of my projects, so I just copy pasted here for your ref.

        @include ($$APPS/setDebugOrRelease.pri)@

        This files has these lines,

        @debug_and_release {
        CONFIG -= debug_and_release
        CONFIG += debug_and_release
        }
        CONFIG(debug, debug|release) {
        CONFIG -= debug release
        CONFIG += debug
        }
        CONFIG(release, debug|release) {
        CONFIG -= debug release
        CONFIG += release
        }@

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #5

          Thanks for the reply.
          If I remove those lines from my .pro file still there are no effect.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #6

            !http://oi59.tinypic.com/2s9xi4k.jpg(Makefile.Release_diffs)!
            For example:
            The diffs in the image shows the Makefile.Release for the unitesttestsuite app (Right) and real app getting called with the Makefile.Release (Left).

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

              Did you clean up properly after removing the CONFIG related lines ?

              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
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #8

                Thanks for the reply.
                I figured out the issue to be in my cutetest.dll which was built in debug and release mode. my unittest app uses cutetest.dll

                @qmake.exe unittests.pro -r -spec win32-msvc2010 "CONFIG+=release" "CONFIG+=CodeCoverage"
                jom.exe -f Makefile.Debug@

                Same .pro file as mentioned above is creating a Program Debug Database (.pdb) file in my "bin" folder instead of debug version of app.
                could you please suggest any directions to figure out what is happening.?

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

                  You explicitly configure for release and then call build on the debug Makefile, that doesn't make sense.

                  If you want to call either Makefile when you want, just configure for debug and release.

                  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
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #10

                    Thanks for the reply.
                    It is working now with the below changes,

                    I removed the release and added both,
                    CONFIG += dll thread debug_and_release build_all

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

                      Good

                      Since you have your build working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

                      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

                      • Login

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