Author Topic: Cross-platform projects and targets  (Read 5058 times)

Offline Commodore64

  • Multiple posting newcomer
  • *
  • Posts: 35
Cross-platform projects and targets
« on: July 11, 2006, 12:57:36 pm »
Hi,

I'm currently writing a cross-platform application with C::B SVN HEAD; I would like to manage it with only one C::B project with many targets. Some targets make sense only in one OS (for example, a target using Visual C++ makes sense only in Windows), other targets can be used in both Linux and Windows.

The problem is that Code::Blocks doesn't recognize compilers used in some targets (in Linux, it doesn't recognize Visual C++) and it messes up those target in the project file (it reverts them to use the standard compiler, i.e. GCC).

Am I missing something? Is there a way to avoid this problem?
Thanks,
Luca

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Cross-platform projects and targets
« Reply #1 on: July 11, 2006, 01:30:12 pm »
Unfortunately, currently there's no way to avoid this.
Be patient!
This bug will be fixed soon...

Offline Commodore64

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Cross-platform projects and targets
« Reply #2 on: July 11, 2006, 02:36:25 pm »
Well, I think I'll open a feature request  :wink:
Thank you!
Luca

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Cross-platform projects and targets
« Reply #3 on: July 11, 2006, 03:56:09 pm »
Unfortunately, currently there's no way to avoid this.

I hate to argue with the guy who made the IDE, but cant you accomplish this with scripts?  You can attach a script to the target and script can check platform and then adjust project options accordingly.  From a very quick look at the script interface this seems possible.

On another note, it doesn't seem to hard to be able to add a platform options to each target.  Something like "compile under", and then a wxChoice box with Linux, Windows, All (and soon Mac).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Cross-platform projects and targets
« Reply #4 on: July 11, 2006, 03:57:50 pm »
I hate to argue with the guy who made the IDE, but cant you accomplish this with scripts?
Good one! This should in fact be possible.
mandrav: Another PRO for scripting... ;-)
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 mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Cross-platform projects and targets
« Reply #5 on: July 11, 2006, 04:07:23 pm »
Unfortunately, currently there's no way to avoid this.

I hate to argue with the guy who made the IDE, but cant you accomplish this with scripts?  You can attach a script to the target and script can check platform and then adjust project options accordingly.  From a very quick look at the script interface this seems possible.

On another note, it doesn't seem to hard to be able to add a platform options to each target.  Something like "compile under", and then a wxChoice box with Linux, Windows, All (and soon Mac).

Heh, yes it is possible this way. I was just referring to the GUI.
You know I 'm always pro-scripting ;)

Here's a read for the OP: http://wiki.codeblocks.org/index.php?title=Build_scripts
Be patient!
This bug will be fixed soon...

Offline Commodore64

  • Multiple posting newcomer
  • *
  • Posts: 35
Re: Cross-platform projects and targets
« Reply #6 on: July 11, 2006, 04:10:22 pm »
The point is that C::B should be told not to touch the settings of a target if the compiler of that target does not exist in the current C::B profile.