Author Topic: Different compilers per target in the same project  (Read 13586 times)

Offline fabrizio.benedetti

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Different compilers per target in the same project
« Reply #15 on: July 11, 2008, 01:09:31 am »
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?

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!

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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Different compilers per target in the same project
« Reply #16 on: July 11, 2008, 06:59:19 am »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Different compilers per target in the same project
« Reply #17 on: July 11, 2008, 07:21:49 am »

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)].

Offline fabrizio.benedetti

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Different compilers per target in the same project
« Reply #18 on: July 11, 2008, 10:10:43 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

Offline matioupi

  • Multiple posting newcomer
  • *
  • Posts: 20
    • Incub'
Re: Different compilers per target in the same project
« Reply #19 on: July 19, 2008, 11:14:06 am »
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/

Offline fabrizio.benedetti

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Different compilers per target in the same project
« Reply #20 on: July 21, 2008, 09:52:17 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