Code::Blocks Forums

User forums => Help => Topic started by: Commodore64 on July 11, 2006, 12:57:36 pm

Title: Cross-platform projects and targets
Post by: Commodore64 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
Title: Re: Cross-platform projects and targets
Post by: mandrav on July 11, 2006, 01:30:12 pm
Unfortunately, currently there's no way to avoid this.
Title: Re: Cross-platform projects and targets
Post by: Commodore64 on July 11, 2006, 02:36:25 pm
Well, I think I'll open a feature request  :wink:
Thank you!
Luca
Title: Re: Cross-platform projects and targets
Post by: Game_Ender 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).
Title: Re: Cross-platform projects and targets
Post by: MortenMacFly 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... ;-)
Title: Re: Cross-platform projects and targets
Post by: mandrav 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
Title: Re: Cross-platform projects and targets
Post by: Commodore64 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.