Custom C rule not used for compiling all .c files
Custom C rule not used for compiling all .c files
- Subject: Custom C rule not used for compiling all .c files
- From: "Mark Wagner" <email@hidden>
- Date: Mon, 5 Jun 2006 12:33:36 -0700
I'm using XCode 1.5 as an IDE for compiling a program for Windows.
I've compiled and installed MinGW as a cross-compiler, and I've got
the libraries needed. Compiling from the command line works just
fine.
Compiling from XCode doesn't. I'm using a Perl script as a wrapper
for MinGW's GCC to adjust the command-line options, and I've got a
custom C rule set up to compile .c files using that wrapper, but it
isn't being used for all .c files.
An example build log. Note that the second file is being compiled
using the system GCC rather than the MinGW GCC wrapper.
Native Build of Target "ndcore.staticlib.win"
CompileC "/DEVELOPMENT
xcode/EE20/libdbg/ndcore.staticlib.build/ndcore.staticlib.win.build/Objects-normal/ppc/args.o"
"/DEVELOPMENT xcode/EE20/base/core/args.c" normal ppc c
org.mingw.gcc.mingw_3.4.2
mkdir -p "/DEVELOPMENT
xcode/EE20/libdbg/ndcore.staticlib.build/ndcore.staticlib.win.build/Objects-normal/ppc"
cd "/DEVELOPMENT xcode/EE20/base/core/ndcore.staticlib"
/opt/mingw/bin/mingwgcc.pl -x c -arch ppc -pipe -Wno-trigraphs -g
-O0 -Wno-unknown-pragmas -fmessage-length=0 "-F/DEVELOPMENT
xcode/EE20/libdbg" "-I/DEVELOPMENT xcode/EE20/libdbg/include"
-I/opt/mingw/i386-mingw32msvc/include "-I/DEVELOPMENT
xcode/EE20/base/core" "-I/DEVELOPMENT
xcode/EE20/libdbg/ndcore.staticlib.build/ndcore.staticlib.win.build/DerivedSources"
"-Wp,-header-mapfile,/DEVELOPMENT
xcode/EE20/libdbg/ndcore.staticlib.build/ndcore.staticlib.win.build/ndcore.staticlib.win.hmap"
-fshort-wchar -include "/DEVELOPMENT
xcode/EE20/base/core/ndcore.staticlib/ndcore.prefix.win.pch" -c
"/DEVELOPMENT xcode/EE20/base/core/args.c" -o "/DEVELOPMENT
xcode/EE20/libdbg/ndcore.staticlib.build/ndcore.staticlib.win.build/Objects-normal/ppc/args.o"
CompileC "/DEVELOPMENT
xcode/EE20/libdbg/ndcore.staticlib.build/ndcore.staticlib.win.build/Objects-normal/ppc/array.o"
"/DEVELOPMENT xcode/EE20/base/core/array.c" normal ppc c
com.apple.compilers.gcc.3_3
cd "/DEVELOPMENT xcode/EE20/base/core/ndcore.staticlib"
/usr/bin/gcc-3.3 -x c -arch ppc -pipe -Wno-trigraphs -g -O0
-mtune=G4 -Wno-unknown-pragmas -fmessage-length=0 "-F/DEVELOPMENT
xcode/EE20/libdbg" "-I/DEVELOPMENT xcode/EE20/libdbg/include"
-I/opt/mingw/i386-mingw32msvc/include "-I/DEVELOPMENT
xcode/EE20/base/core" "-I/DEVELOPMENT
xcode/EE20/libdbg/ndcore.staticlib.build/ndcore.staticlib.win.build/DerivedSources"
"-Wp,-header-mapfile,/DEVELOPMENT
xcode/EE20/libdbg/ndcore.staticlib.build/ndcore.staticlib.win.build/ndcore.staticlib.win.hmap"
-fshort-wchar -include "/DEVELOPMENT
xcode/EE20/base/core/ndcore.staticlib/ndcore.prefix.win.pch" -c
"/DEVELOPMENT xcode/EE20/base/core/array.c" -o "/DEVELOPMENT
xcode/EE20/libdbg/ndcore.staticlib.build/ndcore.staticlib.win.build/Objects-normal/ppc/array.o"
In file included from /opt/mingw/i386-mingw32msvc/include/windef.h:246,
from /opt/mingw/i386-mingw32msvc/include/windows.h:48,
from /DEVELOPMENT
xcode/EE20/base/core/ndcore.staticlib/ndcore.prefix.win.pch:26,
from <command line>:6:
/opt/mingw/i386-mingw32msvc/include/winnt.h:1964:2: #error "undefined
processor type"
<miles of additional error messages snipped>
The wrapper script:
#!/usr/bin/perl
# A wrapper for GCC to strip out command-line arguments that XCode
insists on providing, but that MinGW GCC doesn't understand
use strict;
my @list;
my $skipnext = 0;
foreach $_ (@ARGV)
{
if($skipnext)
{
$skipnext = 0;
next;
}
if($_ =~ /^-arch/)
{
$skipnext = 1;
next;
}
next if($_ =~ /^-F/);
next if($_ =~ /-header-mapfile/);
push @list, $_;
}
exec '/opt/mingw/bin/i386-mingw32msvc-gcc-3.4.2', @list;
Any ideas on what's going wrong?
Thanks,
Mark Wagner
_______________________________________________
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