Lib_ignore vs build_src_filter (the latter was NOT working for me)

I tried every imaginable combination of build_src_filter folder paths to exclude
lib/EthernetTeensy/src as suggested by documenation and ChatGPT.

Every single time the Library Dependency Finder was seeing my main.cpp file
inclusion of EthernetTeensy.h even though it was bracketed by the macro flag
declared in only one of the environments.

I checked that the flag was working by putting ‘#error This is active!’ in the defined
section.

The only solution was: lib_ignore = EthernetTeensy

The documentation states that the LBF is supposed to account for define macro
flags. Why isn’t it working for me?

[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
build_flags = -Wall -Wextra -D COMPILE_FOR_DEVICE

[env:laptop]
platform = native
build_flags = -Wall -Wextra
lib_ignore = EthernetTeensy
; the following did NOT work
build_src_filter = +<*> -<lib\EthernetTeensy\src>

I solved the problem.

The Library Dependency Finder (LDF) ignores the build_src_filter, so I am not sure where that flag is useful.

But…I did find that the default mode of the LDF is ‘chain’ which does NOT handle preprocessor macros such as #ifdef. The ‘chain+’ mode does that.

I have decided that instead of using ‘chain+’, using lib_ignore is a good choice as it is very clear what is being quenched.