Build_src_filter for multiple projects

Hey! So, I want to have multiple independent sources (but with access to the same libs) in one PIO project, switchable via ENV.
Looking into the docs and discussions here I thought using build_src_filter would be pretty straight forward. But it doesn’t work.

platform =

build_src_filter = +<project1>

build_src_filter = +<project2>

This just gives me Error: Nothing to build. Please put your source code files to the 'projectroot\src' folder for both environments. I tried many variations of the filter but the result is the same.
My project structure is simply the standard with src deleted and instead multiple projectX in it.
How do I use this properly?

The build_src_filter is still relative to the src_dir, which is by default src/. So the expected folder structure is <root>/src/project1 and <root>/src/project2, not <root>/project1 etc.

1 Like

Ah :man_facepalming:
So this works now! Thank you!

build_src_filter = +<../project1>

build_src_filter = +<../project2>