Code::Blocks Forums

User forums => Help => Topic started by: Freem on October 04, 2012, 03:53:01 pm

Title: [suggestion] build workspace can not compile files from 2 projet in same time
Post by: Freem on October 04, 2012, 03:53:01 pm
This is not an issue, just a suggestion.

Currently, it seems that using the "build workspace" command just build sequentially all projects. It works nice, but it could be enhanced: when you you have a workspace with several small projects, there is (or I know) no way to compile individual C++ files at the same moment if they belongs to a different project.

By example, you have a big project A, which rely on few libraries and load some plug-ins. If you modify a header of the plug-in API, you will have to recompile most of plug-ins and their host. Currently, C::B is not able to compile in same time 2 plug-ins, because it waits for other to finish.
For the linking step, it makes sense, as linker needs to know symbols from projects on which it depends, but compilation does not.

But I guess it could be very complex to do.
Title: Re: [suggestion] build workspace can not compile files from 2 projet in same time
Post by: oBFusCATed on October 04, 2012, 08:40:23 pm
But I guess it could be very complex to do.
Not that complex. You have to setup proper dependencies.
Patches welcome.
Title: Re: [suggestion] build workspace can not compile files from 2 projet in same time
Post by: MortenMacFly on October 04, 2012, 09:28:25 pm
Currently, it seems that using the "build workspace" command just build sequentially all projects. It works nice, but it could be enhanced: when you you have a workspace with several small projects, there is (or I know) no way to compile individual C++ files at the same moment if they belongs to a different project.
There is, maybe: If you create a virtual target with the same name in each of the (desired) projects you can compile against this target. This will compile only the files that belong to these individual targets.
Title: Re: [suggestion] build workspace can not compile files from 2 projet in [...]
Post by: Freem on October 05, 2012, 04:01:15 pm
But I guess it could be very complex to do.
Not that complex. You have to setup proper dependencies.
Patches welcome.

I thought it could be complex because there could be log issues, if things are made in same time, no?
I mean, I guess simply giving instructions like (on linux)
Code
g++ -o onefile.cpp [...] &
g++ -o another.cpp [...] &
could mess the parser when it come to know which project was successfully compiled or not? If files are from same project and one fail, it is not a problem, the project failed however, but with multiple ones?

Honestly, I am still a little afraid of multi-processing and issues they can generate.

@MortenMacFly:
I fear that I have never used virtual targets... What is their role? Grouping multiple targets of same project? I did not find anything on wiki.

[edit]
When I validate this message, I have a text that spawn and disappear in a red bubble: "le text est trop long [...]" (I made the exact quote... English would have been something like "Text is too long [...]") but had no enough time to see everything.
False positive or ?
Title: Re: [suggestion] build workspace can not compile files from 2 projet in [...]
Post by: MortenMacFly on October 05, 2012, 04:59:00 pm
@MortenMacFly:
I fear that I have never used virtual targets... What is their role? Grouping multiple targets of same project? I did not find anything on wiki.
Read here:
http://wiki.codeblocks.org/index.php?title=Creating_a_new_project#Virtual_Targets

Basically you can not only group targets of a project, but also 1..n targets across 1..m projects in a WS.

See also here:
http://wiki.codeblocks.org/index.php?title=The_build_process_of_Code::Blocks