Arduino automatically discovers required libraries by scanning include directives. Implementing this feature is not only convenient to build unchanged Sketches with CMake. It's also needed to build Sketches for the STM32 core, which populates sketch/requiredLibraries.cpp with include directives for its system libraries.
Arduino automatically discovers required libraries by scanning include directives. Implementing this feature is not only convenient to build unchanged Sketches with CMake. It's also needed to build Sketches for the STM32 core, which populates
sketch/requiredLibraries.cpp
with include directives for its system libraries.The library search order is desribed here: https://arduino.github.io/arduino-cli/1.0/sketch-build-process/#location-priority