On Monday, November 22, 2004, at 08:19PM, Theodore H.Smith <delete at elfdata
dot com> wrote:
>Thanks very much for this great intro.
>
>One question though, is there anyway to compile code via Xcode, that is
>efficient as MrCpp?
>
>I tend to do most of my compilations via a CW/MrCpp combo.
You can setup build rules in your Xcode project to use a different compiler to
compile your source files. You can't change the linker in a standard Xcode
project.
You can create Makefile projects, where Xcode simply runs to build your
project, but you lose out on lots of Xcode's proprietary features: ZeroLink,
Fix-And-Continue, bits of dependency checking that GNU make doesn't do, etc. If
you create a Makefile, you can use any combination of compilers you want.
MrCpp is getting pretty old now. Does MrCpp even work on Mac OS X? I doubt it
produces code that is all that optimal for a G5; it doesn't know anything about
that processor architecture, so probably can't generate code for it that is all
that much better than GCC.
One of the problems will linking your intermediary object files generated by
your custom compiler into a binary. You need a linker which can produce Mach-O
dynamic libraries. The GCC one can, but I don't know if MrCpp produces
intermediary object files that are usable with the GCC linker. You can use the
command-line version of Metrowerks compiler too, but again, I don't think the
object files it generates can be used with the GCC linker.
Another problem is that all the intelligent project management stuff is
designed for working with the GNU GCC compiler for Mac OS X. Xcode will
generate command line arguments for GCC, and it is difficult to disable some of
them: ie for frameworks, optimisation flags only handled by GCC, etc.
I agree that GCC is not the most fantastic compiler available as far as
optimisation is concerned. The current king for PowerPC work is IBM's XLC
compiler, but you need to drop some significant cash for a license for it.
So, to summarise, your options are GCC for compiling and linking, or IBM's XLC
for compiling with GCC for linking.
I'd bet MrCpp and Metrowerks compilers are out of the picture when it comes to
Xcode unless you are writing your own Makefiles.
I would do some profiling with GCC before discounting it, though. There are
lots of games, etc. which have optimised pieces of code and are compiled with
GCC and perform very respectably.
--
James Milne
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|