- 
    Suggestion 
- 
    Resolution: Done
- 
    P3: Somewhat important 
- 
    1.7.2
- 
    None
- 
    macOS 10.12.4 Xcode 8.3.2 
- 
        0b112fa0b27f996fd71c5a0b63132b47b21d7b3e
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.
| For Gerrit Dashboard: QBS-1129 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 197610,5 | Collect cpp.[weak]frameworks from library dependencies | master | qbs/qbs | Status: MERGED | +2 | 0 |