Aggregate target difficulty

Moderator
Posts: 3,571
Joined: 2003.06
Post: #1
The situation is that I have a static library for iPhone. I can build an iPhone.a and an iPhoneSim.a. I can lipo those together. I figured it'd be nice to simply build them and then lipo them automatically, so I created an aggregate target, right? To add the target dependencies, I dragged the iPhone target and iPhoneSim target into the aggregate target. If I try to build that it says:

Quote:[BEROR]No architectures to compile for (ARCHS=, VALID_ARCHS=i386).

I thought there weren't supposed to be any build settings for the aggregate target, but when I look at the info for the aggregate target, there are a few build settings in there. I can delete some of them, but others appear to be permanent.

Approaching this from a different angle, I created a Shell Script Target and added my lipo line to the script window. Without adding the target dependencies, and having already built both of them so they existed, it works just fine to lipo them together. But then, if I try to drag the two targets into the Shell Script Target as dependencies so they'll get built automatically before the script phase, again it gives me the "No architectures to compile for" business.

What am I missing here?

I'm using Xcode 3.2.2
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #2
I think I see what might be the problem, but I don't know how to fix it yet. In the drop down menu of the Xcode main window, where you set your target, etc., if I set it to use BaseSDK then it gives me the "No architectures to compile for" error. I can set it to build for the simulator and it'll build both targets for the simulator, but lipo will naturally complain that they're both i386. I can set it to build for device but then it complains they're both armv6.

So I guess the next question is: How to I get it to use the targets' build config, instead of the one in the drop-down for the aggregate target?
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #3
Well that wasn't easy to figure out, or at least it certainly wasn't obvious, but I managed to fix it. So here's what I figured out:

- Must set the aggregate target to build for Base SDK.
- Make sure base SDK is set in each target's build settings, not just the Xcode drop-down because the drop-down overrides what's in there and you might be misled by that. I don't know if the drop-down setting in each target is in effect during aggregate building or not, but setting it to base SDK as well is what I did to be safe.
- I think you can pretty much ignore the build settings in the aggregate target.
- The error I saw was for one of the targets, not the aggregate target itself, which I missed at first. Turns out it was an error while building the simulator target. To fix that error I had to get info on the sim target and uncheck "Build Active Architecture Only". I don't know why that was checked in the first place. Next, had to set Architectures to "Optimized". Also don't know why that wasn't already set.

Why these particular incantations were needed for building the target through the aggregate target, but not the target when on its own, I do not know.

What I can say is that if errors come up when trying to build an aggregate target, look at the build results pane and don't just look at the error, you need to look above the error to determine which target is having the problem, then fiddle with that target's settings to suit the issue.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Or, just don't use Xcode in the first place XD
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #5
I hear ya'. Wacko

I don't even know if we can use anything besides Xcode for iPhone development.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
Building an iPhone app with the command-line tools is not hard. Uploading it to the phone without Xcode seems to be impossible, but there's probably no reason not to use a makefile to do the actual building...
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #7
AnotherJake Wrote:I don't even know if we can use anything besides Xcode for iPhone development.

I do, using a makefile-based solution. Xcode is only involved for uploading built apps to the device with the Organizer. I'm planning on making my makefile generally available at some point in the near future. If you're interested now, I could give you the bleeding-edge version that I'm currently working with.
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #8
Really? Yeah, sure, I'm interested. email is anotherjake+mac.com

I figure on account of Xcode I've lost like probably at least 22 countable hours in about the last month in lost productivity. Even though I'm not versed in make, I don't suppose it'll take me 22 hours to study and put together an alternative development system to Xcode if you guys say it's reasonably doable.

How about signing for submission to Apple though? I don't understand that process much. Currently, Casey is signing projects on his machine and submitting to Apple for final using his account, and I sign stuff on my machine for ad hoc for development using my account. Do you think I can reasonably work with that as well?

With as much trouble as I've had with Xcode over the years, and especially recently, I'm game for at least attempting something else.

What would you guys recommend for text editing/project management/etc?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #9
TextMate + Make + Terminal
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #10
I'm trying out TextMate. Definitely well made. Two features of Xcode I use a lot are command-double-click to jump to a symbol's declaration, and option-double-click to quickly search documentation for a symbol. I can get by without the search for documentation, but I think I might miss jumping to a symbol's declaration. OTOH, having tabbed documents and clean workspace is really sweet...
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Target Applications not created Ummon 0 2,331 Nov 21, 2007 03:31 PM
Last Post: Ummon
  A question about building target in xcode sakiel 4 4,251 Aug 1, 2007 01:29 AM
Last Post: sakiel
  Target Mac OS X? maaaaark 9 5,943 Feb 9, 2005 10:54 AM
Last Post: iefan