Renato Stauffer
Renato Stauffer

Reputation: 813

Xcode 8.3.3, Linking Framework with Release and Debug version

I have a framework that comes in two versions:

  1. One for debug builds which has some features disabled
  2. One for release builds with all features available

They have the same name (let's call them HotDog.framework) and should now be linked according to a build configuration (Debug or Release).

How would I link the frameworks with Xcode depending on my build configuration?

Thank you very much :)

Upvotes: 1

Views: 3520

Answers (1)

General Failure
General Failure

Reputation: 2597

I see two ways to solve your task:

  1. Path settings (simple way)

    • Put your release and debug framework versions in neighbor folders
    • In Xcode go to project - Build Settings - Search Paths
    • Select and expand Framework Search Paths row
    • Add paths to your debug and release framework versions into appropriate rows inside Framework Search Paths
  2. Build pre-actions (need more research but may be more useful in future)

    • In top menu select Product - Scheme - Edit scheme... (or press Cmd + <)
    • In left side expand Build and select Pre-actions
    • Click + and write script with copying files, relinking frameworks or etc (look command-line tools like xcodebuild, few examples are here)

Upvotes: 3

Related Questions