Search code examples
idelpc

LPCXpresso started rebuilding my entire project every time I do a regular build


LPCXpresso has been working fine, up until some point where it just starts to rebuild the entire project every time a build or debug is initiated.

Is there a simple way to fix this broken behaviour and make it start building correctly again?


Solution

  • Here is what has worked for me - I am not sure if all steps are really necessary:

    1. clean all projects (Project->Clean...->Clean all projects, don't start a build)
    2. Close LPCXpresso
    3. delete .metadata folder (maybe make a backup)
    4. delete the Debug and Release folders from every project in the workspace
    5. Open LPCXpresso - there will not be any projects in your workspace
    6. import the projects: right click in the project explorer->import->general->existing projects into workspace
    7. click browse next to "select root directory" and click ok (this selects the workspace directory)
    8. Select the projects you need and click finish
    9. build each project individually by right clicking on them in the project explorer and selecting "Build Project" (build the projects in the correct order of dependencies)
    10. You will need to recreate the debug target, make sure that "build configuration" is set to Debug, and select "enable auto build"

    This worked for me, but I am not sure what the magic step is/was. Good luck!

    Additional Info

    Sure enough, the problem came back, as it always seems to do. I did a lot more digging and stumbled upon this blog:

    https://mcuoneclipse.com/2015/06/06/eclipse-project-refresh-policy-broken-incremental-build-with-external-make/

    The crux of this is: if the setting for "Refresh Policy" under Project->Properties->C/C++ Build/Refresh Policy is set wrong, then incremental build may be broken and you may get full rebuilds.

    In my case, I had started a long time ago with a demo project and renamed it at some point in time. The refresh policy tab had one resource listed, which was the original project folder name.

    I deleted that resource, then clicked Add Resource... and placed a check mark next to the top level project folder.

    After cleaning things and rebuilding, now the issue seems to be fixed!