2024-01-20 08:09 AM
While working on a specific project, it is very convenient to compile only the files that have been changed. Incremental build is enabled by default in the project settings: Project properties => C/C++ Build => Behavior => Build: (Incremental build) = Enabled.
Then, after working on the project for a while, this option no longer works, although it appears to be still enabled when you look at the project settings.
Workaround: I found out that it can be re-enabled by disabling it in the project settings and then re-enabling it.
When the incremental build is running, the ".cproject" file has the following content - see extract below:
<builder buildPath="${workspace_loc:/DEMO_STM32H743}/Debug" enabledIncrementalBuild="true" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1002271674" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
But when the incremental build no longer works (without disabling it myself via the IDE interface), the content is as follows:
<builder buildPath="${workspace_loc:/DEMO_STM32H743}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1002271674" keepEnvironmentInBuildfile="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
The [enabledIncrementalBuild="true"] option suddenly disappears. I have not been able to reliably determine when exactly this happens. It happened once after I have done the Project Clean. When I tried to do it again today, it didn't happen. I'm also not sure that the issue is only related to the ".cproject" file. Once I opened the same project in a new (clean) workspace and the incremental build worked again.
2024-01-20 09:51 AM
This can be related to inheritance of project settings from the workspace settings.
2024-01-22 12:31 AM
Hi Pavel,
Thank you for your suggestion. It sounds reasonable, but I can't find anything related to incremental build in the workspace settings. I have checked all workspace settings related to build and automate.
The problem is solved if in the settings
Project Properties => C/C++ Build => Behavior => Build: (Incremental build)
I just change Enabled to Disabled and back to Enabled. Meanwhile, I don't do anything with the workspace settings. So probably the workspace settings do not affect this problem.
Best regards,
Branko