• 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: Circular target dependency problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Circular target dependency problem


  • Subject: Re: Circular target dependency problem
  • From: "Timothy J. Wood" <email@hidden>
  • Date: Fri, 27 Jan 2006 08:26:28 -0800


On Jan 25, 2006, at 11:27 PM, Chris Espinosa wrote:


On Jan 25, 2006, at 10:59 PM, Shaun Wexler wrote:

I'm having a problem with Xcode 2.2.1 and a circular dependency with its targets. There are four bundle targets which depend on the app executable using BUNDLE_LOADER = $(BUILT_PRODUCTS_DIR)/ MacFOH.app/Contents/MacOS/MacFOH. The app target has no dependencies on these bundles. I tried to create an Aggregate target, to first build the app, then the four bundles, and then add a Copy Files build phase to move them into the app package. Nope, errors! It's telling me that each item in the copy phase now has a dependency on itself. Any ideas?

The BUNDLE_LOADER build setting is specifically for Unit Testing. Are you using it for that? You don't say above. If you aren't, then eliminate that setting. If you are, and it's creating a circular dependency, you may need to do a separate testing target for your unit tests, because if your app depends on its loadable bundles and the loadable bundles depend on the app, you have indeed created a circular dependency.

BUNDLE_LOADER is useful for any bundle where the app itself exports an API. Often you'll have a framework that the app and bundle both link, but not always.


  At any rate, one solution to this is to have three targets:

	- App
	- Bundles
		- Depends on app
	- Build Package
		- Does the copy into the app

This isn't nearly as pleasant as having Xcode realize the difference between a linking dependency and packaging dependency. There is no circular dependency if the dependency graph splits these two concepts. Link dependencies should be rooted in the 'libraries and frameworks' phase and packaging dependencies in the 'copy files' phases. Then, Xcode could notice that it has a packaging dependency on X.bundle and that it has a target which will build X.bundle, and recurse to build it. Since X.bundle doesn't have a link or package dependency on the app, no circular dependency would be flagged.

  The build process would look like:

	- build A.app
		- check for link dependencies --> none
		- compile & link A.app
		- check for packaging deps --> X.bundle
			- build X.bundle
				- check for link dependencies --> A.app, already linked, done!
				- compile and link X.bundle
				- check for package dependencies --> none
		- package X.bundle into A.app

-tim


_______________________________________________ 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
  • Follow-Ups:
    • Re: Circular target dependency problem
      • From: Shaun Wexler <email@hidden>
References: 
 >Circular target dependency problem (From: Shaun Wexler <email@hidden>)
 >Re: Circular target dependency problem (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: Xcode - linking libraries based on Configuration
  • Next by Date: Re: Getting a SIGALERT - but not sure what thread it's in.
  • Previous by thread: Re: Circular target dependency problem
  • Next by thread: Re: Circular target dependency problem
  • Index(es):
    • Date
    • Thread