Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-95827

qmake CONFIG+=Debug leads to release builds

    XMLWordPrintable

Details

    • macOS, Windows
    • a477a56d5b74f2cca533d9c74e4c8fcf7305794a (qt/qtbase/dev) e5476a199c27985cf7d618a221b6d92f7a2f4c95 (qt/tqtc-qtbase/5.15)

    Description

      There's something counter-intuitive in the way QMake treats CONFIG parameters for controlling "debug" vs. "release" builds. Passing CONFIG+=Debug will in fact lead to a release build, since QMake seem to perform a case-sensitive comparison to "debug" internally.

      This is problematic, since both CMake and Visual Studio uses "Debug" & "Release" for build configuration. Using the same build configuration strings across CMake & QMake projects is therefore susceptible to accidental mis-compiles.

      Example of accidental release build on Windows due to passing "Debug" instead of "debug":

      qmake CONFIG+=Debug
      nmake
      :: A release build is generated despite asking for a "Debug" build
      

      The same problem also seem to occur on MacOS.

       

      Request: Could it be possible to either:

      • Make the QMake CONFIG parameter case-insensitive, so that "Debug" and "Release" will work as expected; or
      • Extend the QMake https://doc.qt.io/qt-6/qmake-variable-reference.html#config documentation to explicitly state that "debug" and "release" are case-sensitive, and that "Debug" will not lead to a debug build.

      Attachments

        For Gerrit Dashboard: QTBUG-95827
        # Subject Branch Project Status CR V

        Activity

          People

            jbornema Joerg Bornemann
            forderud Fredrik Orderud
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes