Multiple environments vs multiple projects

I’m working on a project building many firmwares on different boards sharing some common libs.
I will manage different main functions (call them sub projects), I’m a bit confused on what could be the best solution:

  • multiple environments, one for each firmware: in this case I need some tips on how to filter sources per sub project
  • multiple projects sharing a common library: in this case I need some tips on how to make libraries shared by multiple projects

thank you

For both of these topics and documentation already exist. For the first one you want srcFilter, for the second one you probably want lib_extra_dirs. Examples are e.g. here and here.