Xcode finds dependencies automatically sometimes. I think is is ok when I am the one who is defining the relationships and when I get lazy ...
But more than often I
Xcode Dependency
[About] is a dependency required to build a selected target.
Implicit
dependency
Non-compiled dependencies
. Xcode allows to add a dependency from the whole workspace
. A good example is a Project from GitHub or CocoaPods
[About] with source codePrecompiled dependencies
aka External
- external binary, CocoaPods
, Carthage
with closed codeImplicit dependency
is a dependency that is necessary to successfully build a target, but aren’t explicitly defined.
Build Phases -> Dependencies || Target Dependencies
General ->
Framework, Libraries, and Embedded Content||
Embedded Binariesor
Linked Frameworks and Libraries[Link vs Embed]To turn on this functionality[No such module]
Edit Scheme -> Build -> Find Implicit Dependencies
[Explicit dependency]
[Vocabulary]
This answer applies to Xcode 8.x, and I think for Xcode 9.0.
First off, you need to be sure that "Find Implicit Dependencies" is enabled in the the Build panel of the Scheme that you are attempting to build.
A target "A" can be made "implicitly" dependent on target "B" in two ways:
So why would anyone ever want to do the horror that is "2"? I can come up with a couple of reasons.
If you think these are contrived situations, I'm currently hitting both of them moving some legacy code from a series of explicit dependencies to implicit dependencies. Why am I moving to implicit dependencies? Because explicit dependencies in Xcode require project nesting, and once you get enough explicit dependencies, the project browser gets extremely slow, and you will see a lot of beachballs inside of Xcode for random things.
What happens if you happen to have two targets inside the same workspace that generate products with the same name and depend upon them from a third target? Implicit dependencies will pick one. It appears to do a match based on the base name of the product (so foo/bar.a and baz/bar.a are the same), and will pick the first one it finds.