Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Martin K. on November 28, 2012, 01:15:57 pm

Title: workspace continue build after error
Post by: Martin K. on November 28, 2012, 01:15:57 pm
Hi,

Is it possible to continue a build after one (or more) of the projects raises an error?
Currently the build process stops after the project wich throws error and dont contniue with the next one.

Martin
Title: Re: workspace continue build after error
Post by: oBFusCATed on November 28, 2012, 01:58:16 pm
Why would you need this?
Title: Re: workspace continue build after error
Post by: Martin K. on November 28, 2012, 02:33:11 pm
Why would you need this?

A Workspace with 40 projects, 3 of them doesn't compile, be the rest will. A build/rebuild workspace stopps after the first failed project,so i have to build the rest manual one after the other.
Changing the compiler version for a bigger software packet.

Martin
Title: Re: workspace continue build after error
Post by: oBFusCATed on November 28, 2012, 02:52:18 pm
What I do when this happens is to rename the targets of the broken projects. This way they are skipped by C::B.
In the future I'll try to add an option to disable certain projects, but currently I don't know of such feature.
Title: Re: workspace continue build after error
Post by: MortenMacFly on November 28, 2012, 03:43:41 pm
A Workspace with 40 projects, 3 of them doesn't compile, be the rest will. A build/rebuild workspace stopps after the first failed project,so i have to build the rest manual one after the other.
Changing the compiler version for a bigger software packet.
There is an easy way:

You you use virtual targets to group targets across projects across a workspace together. So if you create in all your project a virtual targets that covers all targets that build but not the ones that don't build you get what you want. Easy!
Title: Re: workspace continue build after error
Post by: Martin K. on November 29, 2012, 06:50:10 am
Hi,

Thanks for this tipps.
I have currently 3 targets in every project. 2 real (release and debug) and one virtual (all, includes release and debug). Now i have to create two mor virtual targets in every project (for release anddebug) and include only those projects in the three virtual targets that compiles fine. I have to build only the virtual targets, and not the real ones. right?

Martin
Title: Re: workspace continue build after error
Post by: MortenMacFly on November 29, 2012, 09:20:14 am
I have currently 3 targets in every project. 2 real (release and debug) and one virtual (all, includes release and debug). Now i have to create two mor virtual targets in every project (for release anddebug) and include only those projects in the three virtual targets that compiles fine. I have to build only the virtual targets, and not the real ones. right?
Yes + yes. That's a common and convenient way to setup and organise targets. Note that a "virtual target" actually does compile the real target(s) it s connected to, but only these - its like grouping.

Also, I don't know why some of your targets do not compile - but if they are for a different platform, you can also use the platform flag to exclude such targets from the build. C::B checks if the build is performed on a compatible platform and skips targets that are defined to be for another platform. The default settings is "All", so all targets are (by default) compatible with all platforms. For you, this might not be the case. So this may be an even easier / more intuitive solution.

Another option you have is to set these targets to a type named "commands only" which does no compilation at all then.

Why do the targets not build? Its pretty weird after all...
Title: Re: workspace continue build after error
Post by: oBFusCATed on November 29, 2012, 09:23:29 am
Why do the targets not build? Its pretty weird after all...
Because he has upgraded his compiler...
Title: Re: workspace continue build after error
Post by: MortenMacFly on November 29, 2012, 09:33:43 am
Because he has upgraded his compiler...
Al-right, so why then not just fix the code step-by-step? That's the actual root of evil then, isn't it? ??? Here, a break of the build is actual really the best that can happen.
Title: Re: workspace continue build after error
Post by: Martin K. on November 29, 2012, 09:43:26 am
I have currently 3 targets in every project. 2 real (release and debug) and one virtual (all, includes release and debug). Now i have to create two mor virtual targets in every project (for release anddebug) and include only those projects in the three virtual targets that compiles fine. I have to build only the virtual targets, and not the real ones. right?
Yes + yes. That's a common and convenient way to setup and organise targets. Note that a "virtual target" actually does compile the real target(s) it s connected to, but only these - its like grouping.

Also, I don't know why some of your targets do not compile - but if they are for a different platform, you can also use the platform flag to exclude such targets from the build. C::B checks if the build is performed on a compatible platform and skips targets that are defined to be for another platform. The default settings is "All", so all targets are (by default) compatible with all platforms. For you, this might not be the case. So this may be an even easier / more intuitive solution.

Another option you have is to set these targets to a type named "commands only" which does no compilation at all then.

Why do the targets not build? Its pretty weird after all...

Here is a team of more than only one programmer and i have setup the new project files and a workspace for them.
Now there are porting there libs and apps step by step to the new compiler. In the meantime, some libs and/or apps doesn't compile. Thats all.
The finest way whould be to disable these projects in the workspace and to show this disabled status in the workspace. So they can go through the workspace and see what projects are ported currently and what to do next.

Martin