News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Different compilers per target in the same project

Started by fabrizio.benedetti, July 08, 2008, 12:01:40 PM

Previous topic - Next topic

fabrizio.benedetti

Quote from: MortenMacFly on July 10, 2008, 09:38:35 PM
compiling a single file always chooses the default compiler which is good (and by design!).
Currently, C::B does not choose the default compiler when compiling a single file. It chooses the default compiler and initializes it, then it chooses the compiler from current build target (possibly uninitialized) and compiles the file --> exception thrown. Is this a bug or not?

Quote from: MortenMacFly on July 10, 2008, 09:38:35 PM
In the end it's for quick tests anyways and not for "serious" programming.
OK, I don't practice serious programming, I'm just a paid programmer releasing commercial products. Incidentally, the beta testers testing my systems think the same about my "serious" programming  :?. Nonetheless, I'd like C::B to meet my needs, and I use "build file" commands every day. I write a bunch of code, then I want to ensure it compiles good on every compiler I target: I don't want to build all my targets for that, I just want to check those lines before I go on. My projects have thousands of source files and final link takes >5 minutes per target: I don't want to spend 20 minutes just to quick test on every compiler that fresh code in that single file!

Quote from: killerbot on July 10, 2008, 10:46:22 PM
no project --> no project compiler.
Why no project? I am compiling 1 single file, but I have a workspace open, with many projects in it, and a build target selected, and I am compiling one of the files added to one of the projects in my open workspace.

  Cheers!
    Fabrizio

MortenMacFly

Quote from: fabrizio.benedetti on July 11, 2008, 01:09:31 AM
Quote from: MortenMacFly on July 10, 2008, 09:38:35 PM
In the end it's for quick tests anyways and not for "serious" programming.
OK, I don't practice serious programming, I'm just a paid programmer releasing commercial products.
You realised the quotation marks, right? There is no need to start offending. I had in mind to clarify things. If that is not needed/wanted I can just shut up.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

killerbot

Quote from: fabrizio.benedetti on July 11, 2008, 01:09:31 AM

Quote from: killerbot on July 10, 2008, 10:46:22 PM
no project --> no project compiler.
Why no project? I am compiling 1 single file, but I have a workspace open, with many projects in it, and a build target selected, and I am compiling one of the files added to one of the projects in my open workspace.

  Cheers!
    Fabrizio

Ok, that's another story then. In the single file compile command I think CB should check if the file is part ofthe active (??) project and apply that project/target's settings [project/target compiler with the project/target build options with specific options specified for the file (if any)].

fabrizio.benedetti

Quote from: killerbot on July 11, 2008, 07:21:49 AM
Ok, that's another story then. In the single file compile command I think CB should check if the file is part ofthe active (??) project and apply that project/target's settings [project/target compiler with the project/target build options with specific options specified for the file (if any)].
Does it really need that check? After all, the command "Build file" is there, and seems to me that it can only be invoked on one of the files from one of the projects in the current workspace, not on a random file from the filesystem. I might be wrong, but shouldn't C::B then apply the settings of the current buildtarget for the project in which the file to be compiled is inserted?

  And please, don't forget there is a condition where an unhandled exception is thrown...

  Ciao
    Fabrizio

matioupi

Hello,

from my user point of view, it would be more natural that the target compiler would be selected when using the compile file command...
If other people have other needs... does it means that it should be a settable behaviour ?

Regards,

Mathieu
--
http://www.incub.net/
--
[url="http://www.incub.net/"]http://www.incub.net/[/url]

fabrizio.benedetti

Quote from: matioupi on July 19, 2008, 11:14:06 AM
it would be more natural that the target compiler would be selected when using the compile file command...

Hi,

  it's not just the target compiler which has to be selected: it's the whole build target configuration; after all, even when compiling only a single file, a compiler has to be selected, but we also need options to pass it, and an ouput folder where to place the compiled obj. All this information (and more) is in the build target settings, which should be correctly applied when compiling a single file - no differently than when compiling all the files in the project and linking them (= build). There is always a current build target selected, so it makes sense to me that it is applied both when building and when compiling a single file.

  Ciao
    fabrizio