User forums > Using Code::Blocks
Team cross-platform development with Code::Blocks?
oBFusCATed:
Hello,
I use C::B for cross platform development too.
I use 1 project file and I define different targets for different platforms. This is very handy, because I don't have to add files to different projects and try to keep them in sync.
But this approach has some problems because of missing features in C::B:
1. If your project is split in one executable + many libraries, you can make 1 project to be one part(lib or exer) and you can put all projects in 1 workspace. But there isn't a mechanism to link targets from different projects to depend on each other. A dev can resolve this dependencies manually, but it is hard and not fun experience (I've a project with only one lib, with more the pain will grow).
2. There is a difference in the way the cbp file is saved between the C::B in linux and in C::B in windows: on linux all file paths in the project file are converted to the linux's style of paths (replacing all '\' to '/'), on windows happens the opposite ('/' are replaced with '\'). This is a problem if you keep the project in svn/cvs, because it makes tracking changes in the project file impossible. If someone adds a file in windows and commits, and then someone else changes something and commits you get the whole project file to be different. There should be some kind of convention about this. You should choose on of the two ways of representing paths and stick to it for the file representation, and do the conversion on loading/saving.
I hope this discussion will continue, and will lead to the improvement of C::B for cross-platform development
Best regards,
Teodor
oBFusCATed:
--- Quote from: tuXXX on September 02, 2008, 09:06:05 am ---
ADDED:
I found how to create different targets... Project->Properties->Build targets and Add/Duplicate ...
But I found that in .cbp we have only one set of compiler options, and they incompatible on different platforms!
Please, help me, how to put two sets of compiler options in ONE project???
One for windows and one for Linux and assign that options to correct build targets?..
--- End quote ---
You have different compiler options for every target (double click the target in the project -> properties (I don't have C::B in front of me so I could have written menu names wrong) or project->build target)
You also have a root target, where you can choose common options for all targets.
Click here and there and you'll get the idea. Also enable the full command line option in 'Settings -> compiler and debugger -> other -> something about output -> full command line'. This way you can see what options are directed to the compiler.
The root/default target reminds me of problem with it:
I have targets which use the gcc compiler and targets which use the vc7.1 compiler. If I set some global define in the root target, where for example the compiler is set to gcc, and then try to compile a target which uses the vc compiler the build fails. The reason is that the define options are formatted the gcc way: -Ddefine1 -Ddefine2, not the vc way: /Ddefine1 /Ddefine2
I'm not sure that this problem is solvable in the generic way... I've solved it by removing the global defines ...
tuXXX:
Oh, big thanks to oBFusCATed =)
I found it! Project->Properties->Build targets->Platforms :)
If I choose not all platforms (as default), but one platform, such as only Windows or only Linux, code::blocks adds compiler options for each target configuration in .cbp file (I needed that)! ^_^
BUT... unfortunately, I need additional _manual_ editings of .cbp file to get all this work fine...
Who can add this vital functionality "multiplatform in one .cpb" in next release of CodeBlocks?
oBFusCATed:
What do you need to edit manually? I've never touched the project file with a text editor to edit it ...
MortenMacFly:
--- Quote from: tuXXX on September 03, 2008, 11:37:44 pm ---BUT... unfortunately, I need additional _manual_ editings of .cbp file to get all this work fine...
--- End quote ---
Huh? I don't get this. ALL parameters in a project file are configurable via the project / target settings. What exactly do you modify in the cbp file by hand?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version