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

Cpp module is not transitive

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 2.1.0, 2.1.2
    • API: JavaScript
    • None
    • Linux/X11

    Description

      https://doc.qt.io/qbs/language-introduction.html#:~:text=A%20module%20can%20depend%20on%20other%20modules.%20For%20example%2C%20the%20Qt.core%20module%20depends%20on%20the%20cpp%20module.%20The%20module%20dependencies%20are%20transitive%2C%20i.e.%20in%20a%20Product%2C%20all%20dependent%20modules%20are%20accessible%3A says:

      "A module can depend on other modules. For example, the Qt.core module depends on the cpp module. The module dependencies are transitive, i.e. in a Product, all dependent modules are accessible:"

      But here in acpp.qbs:

        //  Depends { name: "cpp" }
          Depends { name: "cxx" } 

      cxx module depends on cpp and setting several properties of c++ runtime. So I should have "cpp" module available after that point, right?

      No.

      In Qt Creator I get:

      warning: Item 'cpp' is not declared. Did you forget to add a Depends item?

      and here:

        //  Depends { name: "cpp" }
          Depends { name: "cxx" }
          cxx.lto_off: false
          cpp.defines: {
              var defines=["ACPP_IN_USE"]
              for(var ext_indice=0;ext_indice<enabled_extensions.length;ext_indice++)
              {
                  var ext=enabled_extensions[ext_indice]
                  defines.push(ext+"_AVAILABLE")
                  console.info(ext+" is enabled.")
              }
              return defines;
          }

      the block that is setting "cpp.defines" is not triggered.

       

      Project structure is;

      project.qbs (Project) -> server.qbs (Application) -> acpp.qbs (Module) -> cxx.qbs (Module)

      server.qbs:

          Depends { name: "acpp"}
          cxx.lto_off: true
          acpp.enabled_extensions: ["MAGIC_ENUM","JSON","SIG_SLOT","RAPIDFUZZ_CPP","INDICATORS","UTF8CPP","QT"]
          cxx.cxx_standard: "c++23" 

       

       

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            isgursoy Ismail Gursoy YAVUZ
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes