Author Topic: code blocks with multiple compilers  (Read 5984 times)

Offline benkenobi01

  • Multiple posting newcomer
  • *
  • Posts: 64
code blocks with multiple compilers
« on: April 23, 2012, 04:26:53 pm »
hi,
is it possible to set CB with different compilers, having for ex two .c files in one project each of these files with their own compiler?, i ask because there is this "global compiler options" with the "toolchain executable"  option wich makes it look not being possible.
thanks for your help.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: code blocks with multiple compilers
« Reply #1 on: April 23, 2012, 04:49:32 pm »
You can't use two compilers in a single target, but you can have two targets using different compiler. See Project -> Build options.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: code blocks with multiple compilers
« Reply #2 on: April 23, 2012, 05:17:13 pm »
You can't use two compilers in a single target,
Well in fact you can, if you adjust it in the file's properties accordingly. You'll need a project for this to work and it is a little "hacky", but do-able and there might be good reasons for it.
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 scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: code blocks with multiple compilers
« Reply #3 on: April 23, 2012, 05:40:58 pm »
Doing mostly hardware work with CB, I sometimes have a GUI target and a mcu target and I have an extra question regarding this matter. Is it possible for the editor to open only the corresponding files attached to the active target?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: code blocks with multiple compilers
« Reply #4 on: April 24, 2012, 08:00:28 am »
Doing mostly hardware work with CB, I sometimes have a GUI target and a mcu target and I have an extra question regarding this matter. Is it possible for the editor to open only the corresponding files attached to the active target?
Not for the moment, but a simply patch would do I guess.
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 benkenobi01

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: code blocks with multiple compilers
« Reply #5 on: April 24, 2012, 04:25:27 pm »
yes now it's ok, i'm running on one project some files with minGW and others with cygwin. btw where can i add an environment variable in c::b?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: code blocks with multiple compilers
« Reply #6 on: April 24, 2012, 05:00:25 pm »
Use the environment variables plugin. Settings->Environment -> Environment variables.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: code blocks with multiple compilers
« Reply #7 on: April 25, 2012, 12:35:51 am »
Doing mostly hardware work with CB, I sometimes have a GUI target and a mcu target and I have an extra question regarding this matter. Is it possible for the editor to open only the corresponding files attached to the active target?
Not for the moment, but a simply patch would do I guess.

Well that would be an awesome patch whoever makes it. ;)