User forums > Help

Different compilers per target in the same project

(1/5) > >>

fabrizio.benedetti:
I just can't get this to work. I have the MinGW and the VisualC++2005 correctly configured, but I cannot create a project where one build target uses GCC and another build target uses MSVC. Either way I go, the 2nd compiler fails:

 - I create a new project with Debug + Release configurations using GCC, then I add a MSVC target. The GCC targets build fine, the MSVC target rises an exception (I reported it in the development forum: http://forums.codeblocks.org/index.php?topic=8753)

 - I create a new project with Debug + Release configuration using MSVC, then I add a GCC target. The MSVC targets build fine, the GCC target logs "Execution of mingw32-g++.exe [...] failed".

  I also tried to create the 3rd target by duplicating an existing one, or by Adding a new one - same results.

  I verified that there are no 'global' per-project compiler options, and that the targets don't append their options to the global ones (but that should give command-line errors from the compilers rather than C::B exceptions or failure messages).

  What steps do you take to create multi-compiler projects??? (Killerbot, I hope you're reading this!  :wink:)

fabrizio.benedetti:
  I see that in a project there's a global "Selected Compiler" option, which can be seen by selecting the "Project" | "Build options..." command and then choosing the root in the Build Targets tree, on the left of the "Project build options" dialog. I found that selecting a Build Target is not enough to succesfully build: before building, I must change the "selected compiler" field in the project.

  Is this the right way to go? Is it going to be enhanced in the future? If I can associate a compiler to a Build Target, selecting that Build Target should be enough to build using the associated compiler.

killerbot:
yes, that is correct.

Could you provide me your ?little? test project that fails. I will study it.
Not however that there are combinations of 'project' and 'target' settings. Maybe you have added a project setting and the the target uses append/prepend target settings to project settings. Then you can have issues since a setting on the project level might be compiler specific.

fabrizio.benedetti:
Hi killerbot,

  the test projects were created by wizards, and they're working now - provided I switch the compiler in the global project settings before building. I find it's quite annoying (after switching the project compiler a dialog asks me if I want to set the new compiler in all the Build Targets!) but if that's the way it's supposed to work in the current release, then I think it's not worth your time to study them.

  Now I must find out how will I be able to manage in Code::Blocks my 'real' workspaces (currently implemented in VS6 with some hacking), where I have tens of projects, each with multiple configurations. Manually switching from one compiler to another in all the projects before building would be a little bit time-consuming and error-prone.

  Also, I have to find out if the "Build Target" combobox found on the toolbar only changes the current project's Build Target or if it sets the Build Target in every project of the workspace (provided every project has a Build Target with that name... VS6 works this way, whereas VS2005 has the Configuration Manager which maps a Solution Configuration to projects Configurations).

  Cheers!
    Fabrizio

killerbot:
you should not have to change the compiler on the project level !!
Target is sufficient.

If so, it is a bug.

Therefor could you provide a little test project that fails on your system ?

Navigation

[0] Message Index

[#] Next page

Go to full version