Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static lib linking (XCode 2.1)




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:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >Re: Static lib linking (XCode 2.1) (From: "James Larcombe" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.