Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7653

SDK • Re: When to manually remove or clear an existing build directory ?

$
0
0
CMake adds rules to re-run itself when you change CMakeLists.txt files, so you shouldn't need to do anything extra there. The main times you need to delete the existing build directory and recreate it are when you:
  • Change Platform (eg RP2040 -> RP2350, or Arm -> Risc-V) - this should throw an error message if you haven't deleted the build directory
  • Change Compiler (eg GCC -> Clang) - should also throw an error message
  • Change SDK version from <2.0.0 to >=2.0.0 (and possibly other SDK version transitions in the future)
Sometimes you can just delete the CMakeCache.txt file, but it's safer to just delete the whole build directory.

More generally, if you ever have unexplained build issues, deleting your build directory is usually a good troubleshooting step.

The issue with deleting UF2s and them not rebuilding has been fixed in develop when using the Ninja generator, as a side effect of https://github.com/raspberrypi/pico-sdk/pull/2504 - for Makefile generators you'll still need to use the workaround of deleting the ELF file to get it to rebuild the UF2.

Statistics: Posted by will-v-pi — Mon Jun 30, 2025 10:37 am



Viewing all articles
Browse latest Browse all 7653

Trending Articles