We have a library where we need the includer of our library to be able to select which subsets of our library’s components end up in the build. We already do this when we are built with CMake and make; we’d like the mechanism to look similar when we are built under PlatformIO.
In the make/CMake case, our library is passed a build variable containing “component_a component_b component_c”; if we are passed no such build variable we create one which includes all components. The rest of our make/CMake build script then selects source/header files based on the components that are listed in the build variable.
What would be the “canonical” way to do this in PlatformIO? I can think of a few ways, I’m really interested here in what is the right way from a PlatformIO point of view.