Linking in Geko
When searching for dependencies that will link to a target, geko uses the link type to build a list.
The following dependencies are used for linking:
- Direct dynamic dependencies
- Direct and transitive static dependencies that do not link to dynamic dependencies
For example, let's take a target with tests named UnitTests. The algorithm for building a list of dependencies for linking is as follows:
- Search for all transitive dependencies of the
UnitTeststarget - Remove from this list all static dependencies that are included transitively through dynamic dependencies. For example, let's take the following chain:
UnitTests->DynamicFramework->StaticFramework. OnlyDynamicFrameworkwill be linked inUnitTests, since otherwiseStaticFrameworkwill be duplicated. - Remove all transitive dynamic dependencies that are not directly linked from the link list. For example, for the chainUnitTests->DynamicFramework1->DynamicFramework2,UnitTestswill only be linked toDynamicFramework1, sinceDynamicFramework2is a transitive dynamic dependency. - Remove all transitive static apphost dependencies from the link list. That is, if a test target has an apphost, then all static dependencies that link to apphost will be removed from the test target's link list.
