Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to prevent systematic cleans before builds?(CDT launches many cleans even when they're not necessary. Looking to restrict these cleans to cases when a clean makes sense.)
How to prevent systematic cleans before builds? [message #1665717] Wed, 11 March 2015 11:05 Go to next message
Amenel Voglozin is currently offline Amenel VoglozinFriend
Messages: 23
Registered: September 2009
Junior Member
Hi all,

I'm using CDT 8.6.0 and Luna 4.4.2 on a Windows 8 system to work on a program that has grown over 4 years to be made of dozens of C++ source files.

I have three build configurations for the project: Debug, Release, and CUTE tests. Each build configuration produces an executable that has the configuration as a suffix, i.e. Proj-Debug.exe, Proj-Release.exe, Proj-CUTE.exe.

Each of these executables is tied to a Debug configuration and to a Run configuration.

The problem that I have is that each time I switch to a different Build configuration, the build process starts from zero. Each time I launch either of the Run or Debug configurations, all files are recompiled and the corresponding executable is rebuilt again. Clearly, there's no incremental build happening. For instance, I can click two (or more) consecutive times to launch a Run configuration and the full build happens again. I can close all editors, restart Eclipse and just launch the Run configuration three times in a row without ever doing anything else on the computer, and all objects and artifacts will be rebuilt each single time.

Clearly too, there's a point when CDT launches a build that has "clean" as the target. CDT does so before actually launching the Run configuration and before actually switching to a different build configuration.

I'd like to make these unnecessary "Clean" builds disappear.

My settings are:
* Global preferences > C/C++ > Build > "Build configurations only when there are Eclipse resources changes" is ticked
* Global preferences > Run/Debug > Launching > General options > "Build (if required) before launching" is ticked
* * Project preferences > C/C++ Build > Builder settings is set to the external builder with the command "mingw32-make --file=makefile"
* Project preferences > C/C++ Build > Behavior > Workbench build behavior > "Build (incremental build)" is ticked and set to "all"
* Project preferences > C/C++ Build > Behavior > Workbench build behavior > "Clean" is ticked and set to "clean".

Does anyone see (or think of) anything wrong with that configuration or anything that I might have overlooked? Thanks.
Re: How to prevent systematic cleans before builds? [message #1719640 is a reply to message #1665717] Sun, 10 January 2016 21:05 Go to previous messageGo to next message
JFFB.G.Michi -- is currently offline JFFB.G.Michi --Friend
Messages: 1
Registered: January 2016
Junior Member
Hello there,

I have the same problem and not yet found a solution. It also happens if I "Refresh" the project, but in this case without the "make clean" as output in the console, so I'm not sure if it's related.

Have you found a solution? Thank you
JFF_B.G.Michi
Re: How to prevent systematic cleans before builds? [message #1719753 is a reply to message #1719640] Mon, 11 January 2016 19:43 Go to previous messageGo to next message
Amenel Voglozin is currently offline Amenel VoglozinFriend
Messages: 23
Registered: September 2009
Junior Member
In Project Properties > C/C++ Build, there is a "Refresh Policy" tab on the preference page. I've found that the issue I've reported stops when I add the root of the project to the resources to be refreshed (therefore, I have only the root folder in the list of resources to refresh).

I was baffled when I discovered that, and just to be certain, I repeatedly added and removed the root folder. Each time, the problem stopped then came back.
HTH.
Re: How to prevent systematic cleans before builds? [message #1719769 is a reply to message #1719753] Mon, 11 January 2016 21:46 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
What that does is cause Eclipse to go through the selected directory looking for new and changed files. Eclipse keeps a copy of the directories in your project and only looks for changes when you tell it.

You are apparently letting Eclipse control the builds,. Without the refresh it is unaware of any object files built by the last build. With it, the internal copies are updated after each build.

It's strange this wasn't set in the first place. It has been set on all projects I've created.
Re: How to prevent systematic cleans before builds? [message #1821157 is a reply to message #1719753] Thu, 06 February 2020 12:07 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
Amenel Voglozin wrote on Mon, 11 January 2016 14:43
In Project Properties > C/C++ Build, there is a "Refresh Policy" tab on the preference page. I've found that the issue I've reported stops when I add the root of the project to the resources to be refreshed (therefore, I have only the root folder in the list of resources to refresh).

I was baffled when I discovered that, and just to be certain, I repeatedly added and removed the root folder. Each time, the problem stopped then came back.
HTH.


I LOVE YOU!

I was so confused by this, because it seemed fine on some builds and not others. I have 3 sets of Debug/Release configurations in my project (one pair for each of 3 different targets; native and 2 x cross-compiles). The original Debug and Release seemed to work sensibly but this setting was missing on the cross builds.

It looks like the "Refresh Policy" isn't (necessarily!) copied across when you create a new Build Configuration. Either that, or some change to the settings caused it to disappear.

I'll be creating more projects like this so will try to narrow the problem down (this is on 2019-09 BTW).

Thank you
Re: How to prevent systematic cleans before builds? [message #1823325 is a reply to message #1821157] Tue, 24 March 2020 22:48 Go to previous message
Thomas Lauke is currently offline Thomas LaukeFriend
Messages: 1
Registered: March 2020
Junior Member
Any progress in hunting this bug?

We see the same behaviour with 2019-12 also ...
Previous Topic:Making a new launch configuration for every new piece of code?
Next Topic:Eclipse 2020-03 No upload to Arduino Due
Goto Forum:
  


Current Time: Thu Sep 12 16:14:20 GMT 2024

Powered by FUDForum. Page generated in 0.05161 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top