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

Automatically export cpp.frameworks like for libraries

    XMLWordPrintable

Details

    • 0b112fa0b27f996fd71c5a0b63132b47b21d7b3e

    Description

      This applies to Apple platforms.
      Currently a StaticLibrary that links against a framework using cpp.frameworks: [...] must also export that dependency for other targets that depend on it using Export. Otherwise the framework is not linked into the dependent target.

      Consider the following qbs file:

        StaticLibrary {
          name: "some-library"
          files: ["source.m"]
          Depends { name: "cpp" }
          cpp.frameworks: ["Foundation"]
        }
      
        CppApplication {
          name: "some-app"
          files: ["another-source.c"]
          Depends { name: "some-library" }
        }
      

      At build time, the linker will complain about symbols from the Foundation framework not being available. Changing the StaticLibrary above to:

        StaticLibrary {
          name: "some-library"
          files: ["source.m"]
          Depends { name: "cpp" }
          cpp.frameworks: ["Foundation"]
          Export {
            Depends { name: "cpp" }
            cpp.frameworks: ["Foundation"]
          }
        }
      

      is required for the dependent application to link properly.

      For convenience, the frameworks used by a target (library) should automatically be exported.

      Attachments

        Activity

          People

            jbornema Joerg Bornemann
            pvaibhav.tobyrich Prashant Vaibhav
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: