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

Product.condition depending on module values might fail

XMLWordPrintable

    • 2b14c324a337fec379e77ce0c12e273d08934537

      The following project

      // modules/mybuildconfig/mybuildconfig.qbs
      Module {
          property bool falseProperty: false
      }
      
      // app.qbs
      Product {
          condition: mybuildconfig.falseProperty
          Depends { name: "does.not.exist" }
          Depends { name: "mybuildconfig" }
      }
      

      produces the error

      app.qbs:4 Can't find variable: mybuildconfig
      

      because mybuildconfig is indeed not loaded, because the module loader bails out as soon as does.not.exist cannot be loaded.

      Reordering the Depends items fixes the problem.

      // app.qbs
      Product {
          condition: mybuildconfig.falseProperty
          Depends { name: "mybuildconfig" }
          Depends { name: "does.not.exist" }
      }
      

      This is especially harmful in cases where inheritance is involved, because that makes it hard to control the order of Depends items.

        1. QBS-1338.tar.xz
          0.4 kB
          Joerg Bornemann
        For Gerrit Dashboard: QBS-1338
        # Subject Branch Project Status CR V

            kandeler Christian Kandeler
            jbornema Joerg Bornemann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes