Reputation: 191
I feel so noob asking this question, but what is a target dependency? I see it all the time in Xcode.
Upvotes: 19
Views: 14096
Reputation: 34225
Xcode Explicit Dependency
Xcode Dependency
[About] is a dependency required to build a selected target.
Explicit dependency
Explicit
dependency is a source code aka Non-compiled dependency
. Xcode builds all explicit dependencies
before the dependent target. Explicit dependency
overrides implicit dependency
with the same product_name.
Explicit Dependency
is specified in Build Phases -> Target Dependencies
.
There are multiple ways to specify in Xcode that our target depends on other target’s products:
cross-project reference
[About]Additional notes:
Dynamic Framework
General -> Embedded Binaries
. If not - on the real device you will get dyld: Library not loaded
[About]General -> Embedded Binaries
and select a product that is explicit dependency, Xcode automatically add it into Build Phases -> Target Dependencies
Static binary
Build Phases -> Target Dependencies
Upvotes: 9
Reputation: 13612
A dependency is another target that must be built before the current target can be. For example, if you have an app target and a framework target, the app target can have the framework target as a dependency, to ensure that the framework is built first. That is, the app target "depends" on the framework.
Upvotes: 21