• 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: Static lib linking (XCode 2.1)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static lib linking (XCode 2.1)


  • Subject: Re: Static lib linking (XCode 2.1)
  • From: Paul Walmsley <email@hidden>
  • Date: Fri, 25 Nov 2005 13:21:37 +0000


Now, make a modification to a file in S, and hit "Build" in A's project window. "A" knows that "S" is a dependency, and builds it, but DOES NOT LINK AGAINST THE RESULTING LIBRARY. In other words, the build step for A occurs, but has no content, because it doesn't think anything has changed (it doesn't notice the new library, apparently).

This is 100% reproducible for me, and it's driving me nuts

I've got a workaround, which is rather gross but at least ensures you've got an up-to-date build:


   * Add a Script phase and ensure that it comes before the 'Link
     Binary with Libraries' build phase.
   * Set the contents of the script to:

     if [ -f "$TARGET_BUILD_DIR/$TARGET_NAME ]; then
        rm "$TARGET_BUILD_DIR/$TARGET_NAME"
     fi

The crap part of this is that if you make a change in a sub-project you may need to hit build twice -- the first will ensure the target is trashed and the second will cause it to be linked. This occurs since xcode appears to calculate dependencies before it executes the script phases. So the first time it will decide that it won't relink *before* the above phase deletes the target. The second time the target doesn't exist so the dependency check forces a full link.



_______________________________________________
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: 
 >Re: Static lib linking (XCode 2.1) (From: "James Larcombe" <email@hidden>)

  • Prev by Date: Re: Adding an executable to a copy file phase
  • Next by Date: XCode 2.1: Custom projects
  • Previous by thread: Re: Static lib linking (XCode 2.1)
  • Next by thread: XCode 2.1: Custom projects
  • Index(es):
    • Date
    • Thread