Re: Using different compilers for C vs C++?
Re: Using different compilers for C vs C++?
- Subject: Re: Using different compilers for C vs C++?
- From: "Sean McBride" <email@hidden>
- Date: Thu, 18 Feb 2010 12:32:08 -0500
- Organization: Rogue Research Inc.
On 2/13/10 11:26 AM, Jean-Daniel Dupas said:
>> Thanks for this pointer! I've also just read the "Build Rules" section
>> of the Xcode docs. Alas, I still can't get this to work.
>>
>> I've opened the target inspector and created a rule (which is at the top
>> of the list)
>> Process: C++ files
>> using: Rez
>>
>> I expect catastrophic failure. Everything still builds. I've tried
>> other choices for 'using' and it seems to have no effect. I have no
>> other custom rules anywhere (as best as I can tell).
>>
>> Any ideas?
>
>Yes, try with GCC and LLVM-GCC instead of trying with Rez.
>I have redefined C rule tu use GCC-4.2 and add a C++ rule to use llvm-
>gcc and it works (if you want to know if it works, check the transcript )
>Xcode built-in compiler have a list of supported file type, so it will
>probably refuse to use Rez fro c++ and fallback to the default setting.
The test with Rez was a last resort, my initial tests were with C & C++
rules. So I've just tried this:
- create new project from Cocoa Application stationary
- add a .c file
- add a .cp file
- put the following in both:
#if __GNUC_MINOR__ == 0
#warning gcc 4.0
#elif __GNUC_MINOR__ == 2
#warning gcc 4.2
#endif
First I changed between gcc 4.0 and 4.2 by changing GCC_VERSION, this
worked as expected.
Then I:
- went to the target setting > Rules
- I changed the C rule, it said I need to make a duplicate, fine
- it added a new item to the top of the list, fine
- I set "Process" to "C++ source files" and "using" to "GCC 4.0"
- close the window
- clean all
- quit & relaunch Xcode
- build
- examine compiler warnings -> it's still using gcc 4.2
I hope I'm just missing something obvious here....
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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