News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Adding Multiple Compilers

Started by puneet_m, October 25, 2007, 01:16:51 AM

Previous topic - Next topic

puneet_m

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,

Biplab

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.

thomas

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."

puneet_m

Where is the code for wxWidget target wizard??

Biplab

Quote from: puneet_m on October 25, 2007, 05:55:30 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.

puneet_m

Can we add multiple compilers to the same target?

Thanks,

Biplab

Quote from: puneet_m on October 26, 2007, 08:18:40 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.

puneet_m

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>

Biplab

Quote from: puneet_m on October 26, 2007, 08:36:03 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.

thomas

#9
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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

hd

Hi,

Quote from: puneet_m on October 26, 2007, 08:36:03 PM
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

thomas

Quote from: hd on October 27, 2007, 10:37:38 PMNot 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."

huhlig

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'.

thomas

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."

huhlig

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.