yonaskolb / yonaskolb/XcodeGen

Why a static library cannot be linked to a framework but can be linked to an application?

Open
#1,540 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
8.8k
Forks
908
Avg merge
17d 14h
Merged PRs (30d)
2

Description

Background

I have the following structure:

  1. CoreDomain target of type library.static.
  2. MyApplication target of type application.
  3. CoreData target of type framework.

When I link the static library to my MyApplication target with the following code:

dependencies:
      # Internal Dependencies
      - target: CoreDomain

It works fine and I see libCoreDomain.a in the Frameworks, Libraries and Embedded content section.

Problem

However, doing the same as above with CoreData framework, the libCoreDomain.a is not linked.

IMPORTANT

I can add the libCoreDomain.a manually to my framework, but not through xcodegen

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how XcodeGen handles target dependencies for framework targets versus application targets, using the shown CoreDomain, MyApplication, and CoreData configuration as the reproduction. Compare the generated project with the manually linked setup; done means the generated CoreData framework links libCoreDomain.a through the target dependency configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift, yaml
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.