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

qmake *= operator (Adding Unique Values) overrides previous value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.15.8, 5.15.3
    • Build tools: qmake
    • None
    • Windows

    Description

      trying to build qt with QT_DISABLE_DEPRECATED_BEFORE=0x050F00 as a start to migrate to qt6. (by the way, a question: should i build both qt and my project with this define or only my project? in any case the report is still valid) and i'm seeing strange errors. figured out that \qtbase\mkspecs\features\qt_module.prf is overriding my define by the following line:

      DEFINES *= QT_DISABLE_DEPRECATED_BEFORE=0x040800

      so i tried the following: added another value right after existing in that file. like that:

      win32 {
          # On Windows, due to the way DLLs work, we need to export all functions,
          # including the inlines
          DEFINES *= QT_DISABLE_DEPRECATED_BEFORE=0x040800
          DEFINES *= QT_DISABLE_DEPRECATED_BEFORE=0x050800
      } else {
          # On other platforms, Qt's own compilation goes needs to compile the Qt 5.0 API
          DEFINES *= QT_DISABLE_DEPRECATED_BEFORE=0x050000
      }

      and to see the result in some .cpp file i've also added this:

      #define QuoteIdent(ident) #ident
      #define QuoteMacro(macro) QuoteIdent(macro)
      #ifdef QT_DISABLE_DEPRECATED_BEFORE
          static_assert(false, "QT_DISABLE_DEPRECATED_BEFORE defined " QuoteMacro(QT_DISABLE_DEPRECATED_BEFORE)"\n");
      #else
          static_assert(false, "QT_DISABLE_DEPRECATED_BEFORE not defined\n");
      #endif

      and i see this as a result:

      error C2338: static_assert failed: 'QT_DISABLE_DEPRECATED_BEFORE defined 0x050800'

      which means that operator *= does override previous value.

      tried this on 5.15.3 and 5.15.8.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            artur.kuznetcov Artur Kuznetcov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes