• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Direct Dependencies clarification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Direct Dependencies clarification


  • Subject: Re: Direct Dependencies clarification
  • From: Chris Hanson <email@hidden>
  • Date: Tue, 22 Jul 2008 15:27:27 -0700

On Jul 22, 2008, at 10:36 AM, Matt Gough wrote:

Our app makes use of several dylibs created by sub-projects, such as:

strings.dylib (Strings.xcodeproj Target:strings)
graphics.dylib (Graphics.xcodeproj Target:graphics)

The graphics.dylib is also dependant on strings.dylib, so the graphics target has strings as a Direct Dependency, the app is dependent on strings and graphics.

In my App's target settings, should I add both strings and graphics as Direct Dependancies, or just graphics (since strings is 'inherited' by the dependency on graphics)?

The former. You should be as explicit as possible when it comes to things like a target's direct dependencies, because that enables Xcode to be as smart as possible when it comes to deciding what needs to be built and when to do so. See below for more explanation.


So what really is the meaning of 'Direct' in this context? Is it any target that is explicitly used by the target's binary, instead of implicitly?

You should list B as a direct target dependency of A if B's product is required to generate A's product.


Is there any harm in having the same target appearing multiple times in the same dependency tree?

No, because even though it looks like a tree if you just look at the "direct dependency" panes, it's actually a graph. Thus each node appears once, to represent what it produces, with edges connecting it to the things that depend upon it and upon which it depends.


To use your later example, you have a dependency graph that looks like this (using a pseudo-Makefile syntax):

  app: graphics strings maths
  graphics: strings maths
  strings: maths
  maths: whatever

Xcode will always build everything in this dependency graph in the proper order because it will be able to figure out that maths must be built before everything else.

What's even better is that if you add another target that only graphics and app depend on, and you have the "build independent targets in parallel" project option turned on, it will be built right alongside maths and strings. Xcode can resolve the dependency graph to determine not only which nodes depend on others, but also which nodes don't, so it can maximize your build throughput.

  -- Chris

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Direct Dependencies clarification (From: Matt Gough <email@hidden>)

  • Prev by Date: Re: Changing __MyCompanyName__ in existing Nib/Xcode project?
  • Next by Date: Re: type-punning to incomplete type might break strict-aliasing rules
  • Previous by thread: Direct Dependencies clarification
  • Next by thread: Changing __MyCompanyName__ in existing Nib/Xcode project?
  • Index(es):
    • Date
    • Thread