CocoaPods/CocoaPods

Can I mix frameworks and static libraries in a single target?

开放

#7,773 创建于 2018年5月23日

 (1 条评论) (0 个反应) (0 位负责人)Ruby (2,685 个派生)batch import
d3:hardhelp wantedt1:enhancement

仓库指标

星标
 (14,815 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Report

As best as I can tell from reading the documentation, there's no way to have a mixture of static library and framework source dependencies in a single target. It does seem to be supported if the pod contains a prebuilt binary (e.g. my current project has use_frameworks! but has at least one dependency that is just a prebuilt static library, and it works), just not for building from source.

Am I missing something here, or am I understanding this limitation correctly?

I'm asking because at least one of the pods I vend (probably 2 but I haven't confirmed) doesn't currently build as a static library (see #7771). It's a Swift dependency so until 1.5.0 it didn't matter as Swift dependencies required use_frameworks!, but now that static libraries are supported for Swift, I'm looking for a solution that will allow me to remove use_frameworks! from my downstream project while still using my pods (a solution that doesn't involve shipping a prebuilt binary).

If I am understanding this limitation correctly, then I'd request one of the following (ideally both):

  1. Allow me to specify in a pod declaration that it should use frameworks (or static libraries).
  2. Allow me to specify in a podspec that the pod only supports being built as a framework.

If I'm not understanding this limitation correctly and there is a way to declare one or both of these, then the documentation should be updated to describe how.

贡献者指南