Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: aphirst on March 01, 2017, 05:53:53 pm

Title: Exclude Projects from Workspace Rebuild?
Post by: aphirst on March 01, 2017, 05:53:53 pm
I have a workspace which contains the projects (names replaced) "myproj", "dep1" and "dep2". In the settings for "myproj", both "dep"s are marked as Project Dependencies. This means that if there are changes to source files in either "dep", the "dep" is also built whenever I build the main project. So far, so good.

However, whenever I click "rebuild" on the Compiler toolbar in the main C::B window, all three projects are rebuilt, not just the active "myproj". The dependencies are somewhat large, especially compared to my project, so it seems excessive to do this. What I would like to do is have the "rebuild" button only rebuild my active project, not the entire workspace. Is this possible somehow? I've tried to work it out in the settings but haven't had much luck, and similarly asked in the IRC channel to no avail. Searching the forums for keywords like "exclude project workspace rebuild" didn't yield anything relevant.

If anyone wants me to clarify my question, feel free to ask. :)
Title: Re: Exclude Projects from Workspace Rebuild?
Post by: cacb on March 01, 2017, 06:09:26 pm
Good point. I have seen this also. An special option to rebuild a single project but not its dependencies would be useful.
Title: Re: Exclude Projects from Workspace Rebuild?
Post by: stahta01 on March 01, 2017, 06:21:57 pm
Remove the project dependencies.

I prefer to use the external dependencies without using any project dependencies.

Tim S.
 
Title: Re: Exclude Projects from Workspace Rebuild?
Post by: stahta01 on March 01, 2017, 06:33:49 pm
Good point. I have seen this also. An special option to rebuild a single project but not its dependencies would be useful.

Create a separate workspace with no project dependencies.

Tim S.
Title: Re: Exclude Projects from Workspace Rebuild?
Post by: Commaster on March 01, 2017, 06:36:30 pm
What happens, if you right-click the project on the side panel and select Rebuild there?
Title: Re: Exclude Projects from Workspace Rebuild?
Post by: aphirst on March 01, 2017, 06:44:49 pm
What happens, if you right-click the project on the side panel and select Rebuild there?
I get the exact same behaviour as I mention in my original post.
Title: Re: Exclude Projects from Workspace Rebuild?
Post by: killerbot on March 01, 2017, 08:23:01 pm
I think this is a good suggestion, to indeed have a non recursive (non dependency) build, sometimes I also wish for that. Certainly when for example you are depending on like +-100 libraries, then I takes a lot of time to just visit tehm all to conclude nothing needs to be done there.
Title: Re: Exclude Projects from Workspace Rebuild?
Post by: BlueHazzard on March 01, 2017, 09:22:47 pm
I made a experimental plugin that can do this: https://github.com/bluehazzard/cbSelectiveCompiling
It won't work with the current Codeblocks, because it is a squirrel plugin, but i think this would be an idea to port.
Title: Re: Exclude Projects from Workspace Rebuild?
Post by: oBFusCATed on March 02, 2017, 12:20:16 am
This is not a feature a plugin should implement. It should be added to the compiler plugin.

@killerbot: The slowness is a cb problem and not a problem with checking file's timestamps. I think I have a partial solution in the works.
Title: Re: Exclude Projects from Workspace Rebuild?
Post by: cacb on March 02, 2017, 08:32:27 am

Create a separate workspace with no project dependencies.

Tim S.

I have, and want to have, a single workspace with the dependencies described. I don't want to model the same dependencies in multiple workspaces to work around this issue. It is just that sometimes, as you are editing the source of one of the projects, you know you will have to rebuild the current project, but not the projects upon which it depends. It is as simple as that.

All my projects generate object files and binaries in a .cmp subfolder. My current work around for the above situation is to delete that subfolder and hit build instead of rebuild. I guess if C::B could offer an option to "Clear this project but not the dependencies" it would be a way to handle this situation.