Author Topic: Adding Multiple Compilers  (Read 17118 times)

Offline puneet_m

  • Multiple posting newcomer
  • *
  • Posts: 73
Adding Multiple Compilers
« on: October 25, 2007, 01:16:51 am »
I want to add a separate compiler for each of the target in a given project. But currently, addition of multiple compilers is not supported. Can anyone highlight as to how to fix this?

Thanks,

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Adding Multiple Compilers
« Reply #1 on: October 25, 2007, 05:37:14 am »
This is possible. Just take a look at wxWidgets Target wizard, where you can add a new target to an existing project with a different compiler. At the moment it won't work as some compiler options are added at project level which spoils this wizard. :)
Be a part of the solution, not a part of the problem.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Adding Multiple Compilers
« Reply #2 on: October 25, 2007, 08:41:02 am »
There are only few examples where it really makes sense to do that (for example if a project contains sources in different languages, which are to be linked into one program). However, whether it makes sense or not, it is certainly supported.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline puneet_m

  • Multiple posting newcomer
  • *
  • Posts: 73
Re: Adding Multiple Compilers
« Reply #3 on: October 25, 2007, 05:55:30 pm »
Where is the code for wxWidget target wizard??

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Adding Multiple Compilers
« Reply #4 on: October 25, 2007, 06:48:09 pm »
Where is the code for wxWidget target wizard??

<C::B-dir>\share\CodeBlocks\templates\wizard\wxwidgets\wizard.script
Be a part of the solution, not a part of the problem.

Offline puneet_m

  • Multiple posting newcomer
  • *
  • Posts: 73
Re: Adding Multiple Compilers
« Reply #5 on: October 26, 2007, 08:18:40 pm »
Can we add multiple compilers to the same target?

Thanks,

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Adding Multiple Compilers
« Reply #6 on: October 26, 2007, 08:23:54 pm »
Can we add multiple compilers to the same target?

Exactly what do you want to do?
Be a part of the solution, not a part of the problem.

Offline puneet_m

  • Multiple posting newcomer
  • *
  • Posts: 73
Re: Adding Multiple Compilers
« Reply #7 on: October 26, 2007, 08:36:03 pm »
I want to add multiple compilers to same target, check the example below:

<Target title="Debug">
<Option output="bin\Debug\fd.exe" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Debug\" />
<Option type="1" />

<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>

<Option compiler="bcc" />
<Compiler>
<Add option="-b" />
</Compiler>

</Target>

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Adding Multiple Compilers
« Reply #8 on: October 26, 2007, 08:42:17 pm »
I want to add multiple compilers to same target, check the example below:

AFAIK, it isn't allowed.
Be a part of the solution, not a part of the problem.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Adding Multiple Compilers
« Reply #9 on: October 27, 2007, 02:32:38 pm »
This is not possible (and will not be), as it does not make sense. The build system needs to have unambiguous information about what compiler to use.
« Last Edit: October 27, 2007, 02:34:12 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline hd

  • Multiple posting newcomer
  • *
  • Posts: 45
    • http://www.dynaset.org/dogusanh
Re: Adding Multiple Compilers
« Reply #10 on: October 27, 2007, 10:37:38 pm »
Hi,

I want to add multiple compilers to same target, check the example below:

Not multiple compiler for the same target, but you may add multiple target using different compiler for each. (Maybe you already know this but..)

--
Regards,
Hakki Dogusan

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Adding Multiple Compilers
« Reply #11 on: October 28, 2007, 12:28:51 am »
Not multiple compiler for the same target, but you may add multiple target using different compiler for each. (Maybe you already know this but..)
Yes, this works, and this makes perfect sense.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline huhlig

  • Single posting newcomer
  • *
  • Posts: 4
Re: Adding Multiple Compilers
« Reply #12 on: April 25, 2008, 09:23:20 am »
Would it be possible to use multiple compilers in the same target for different file extensions or individual files. I am working on a mixture of C and D and need multiple compilers to accomplish this. The option seems to be available on the Files advanced tab but it never seems to 'stick'.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Adding Multiple Compilers
« Reply #13 on: April 25, 2008, 09:39:50 am »
No, although it accidentially works nevertheless if you use gcc (since gcc is not a compiler, but really a front-end to half a dozen compilers). One target, one compiler, it doesn't work differently.
What you can do is, use the C compiler in one target to compile, but not link. Then add the object files to the next target which uses the D compiler (or the other way around). Or, make a static library, which only requires you to link one file afterwards (instead of a dozen object files).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline huhlig

  • Single posting newcomer
  • *
  • Posts: 4
Re: Adding Multiple Compilers
« Reply #14 on: April 25, 2008, 05:23:43 pm »
Any particular reason for this lack of functionality? I am curious, the only reason I can find seems to be "it doesn't make sense" which multiple people have refuted.