Author Topic: [suggestion] build workspace can not compile files from 2 projet in same time  (Read 6675 times)

Offline Freem

  • Almost regular
  • **
  • Posts: 218
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
But I guess it could be very complex to do.
Not that complex. You have to setup proper dependencies.
Patches welcome.
(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: 9723
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.
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 Freem

  • Almost regular
  • **
  • Posts: 218
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 ?
« Last Edit: October 05, 2012, 04:04:13 pm by Freem »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
@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
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