Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1225

cpp.cxxLanguageVersion set by user module conflicts with value in Qt.core

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 1.9.1
    • Fix Version/s: 1.12.0
    • Labels:
      None
    • Commits:
      2bda52aa3d50deb56128f42395ae9f2686af2a99

      Description

      The Problem

      Consider a product that

      • depends on Qt.core (which sets cpp.cxxLanguageVersion)
      • depends on another module "globals" that sets¬†cpp.cxxLanguageVersion

      Module "globals" might be user-provided to set project-global properties as we recommend to do.

      Resolving such a product will print a warning:

      WARNING: Conflicting scalar values at /home/jobor/.config/QtProject/qbs/1.10.0/profiles/qt591/modules/Qt/core/core.qbs:94:29 and /home/jobor/playground/collidingModuleProp/modules/globals/globals.qbs:3:29.
      

      ...because cpp.cxxLanguageVersion is a scalar property, and qbs doesn't know how to resolve the conflict between scalar properties.

      Proposed Solution

      Provide a way to resolve conflicts on scalar properties. This could be done like this:

      // In the cpp module
      PropertyOptions {
          name: "cxxLanguageVersion"
          resolveConflict: function (a, b) {
              return cxxLanguageVersionLessThan(a, b) ? b : a;
          }
      }
      

      The function resolveConflict either returns a valid value or throws an exception. The default implementation returns the first parameter and prints the warning above.

        Attachments

          Issue Links

          For Gerrit Dashboard: QBS-1225
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              kandeler Christian Kandeler
              Reporter:
              jbornema Joerg Bornemann
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes