• 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: Cross OS version UB development
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross OS version UB development


  • Subject: Re: Cross OS version UB development
  • From: Shawn Erickson <email@hidden>
  • Date: Sat, 24 Feb 2007 11:00:36 -0800


On Feb 24, 2007, at 10:15 AM, Andreas Wittenstein wrote:

It is probably safer to create two targets in your project, one for Intel only (using 10.4) and one for PPC (10.2) and meld them together using lipo in a 3rd target that has only a run script build phase.

Why? Xcode supports building a UB directly for you (by default Release configuration does this while Debug only build the platform you are running on). You don't need to make it harder on yourself. This capability works fine so I suggest you use it.

Because I'm not an Xcode wizard.

You don't have to be.

Right. And you have to be a terminal wizard to set up script phase that lipos your binaries. This was necessary in Xcode 2.1, but those days, luckily, are long gone.

I wish that were true. Unfortunately, Xcode's automatic Universal Binary creation facility always applies exactly the same rules to exactly the same set of files for both the ppc and i386 editions of a Universal Binary. Any deviation from this prescription requires that the two editions be lipo'd together manually. ...this means I have many processor-specific source files with processor-specific flags

I don't see why you cannot use it.

If you have different files that contain processor specific implementation then you can specify per file compiler flags as needed (sounds like you are doing this) and wrap the code in those files with architecture ifdefs (__i386__, __ppc__, etc.). Then at compile time each file should gets compiled with the correct flags and code not meant for a particular architecture would be ignored. Unless you really don't have different source files for different target CPUs.

Also you can use PER_ARCH_CFLAGS_i386, PER_ARCH_CFLAGS_ppc, OTHER_LDFLAGS_i386, and OTHER_LDFLAGS_ppc to define architecture- specific flags. These options likely cover the common cases well enough for most folks and I think can cover your case as well.

-Shawn
_______________________________________________
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: Cross OS version UB development
      • From: Eric Albert <email@hidden>
References: 
 >Cross OS version UB development (From: "Theodore H. Smith" <email@hidden>)
 >Re: Cross OS version UB development (From: John Daniel <email@hidden>)
 >Re: Cross OS version UB development (From: Shawn Erickson <email@hidden>)
 >Re: Cross OS version UB development (From: John Daniel <email@hidden>)
 >Re: Cross OS version UB development (From: Shawn Erickson <email@hidden>)
 >Re: Cross OS version UB development (From: "Alexander v. Below" <email@hidden>)
 >Re: Cross OS version UB development (From: Andreas Wittenstein <email@hidden>)

  • Prev by Date: Re: Cross OS version UB development
  • Next by Date: Re: Templates question
  • Previous by thread: Re: Cross OS version UB development
  • Next by thread: Re: Cross OS version UB development
  • Index(es):
    • Date
    • Thread