File being included despite macro preventing it

I’m at a complete loss as to why the FlexIO SPI headers are being included from the XPT2046_Touchscreen library when building for Teensy 3.6 which causes the build to fail.

If I edit the library to remove the include directive below, it builds with no errors. VS Code is showing that this section is not enabled anyway, so not sure why it’s being included.

#if defined(__IMXRT1062__)
#if __has_include(<FlexIOSPI.h>)
	#include <FlexIOSPI.h>
#endif
#endif

I’ve tried compiling on 2 PCs with the same results. It seems to compile without any problems if I use the Arduino IDE with a similar config.

Here is a link to a ZIP archive of the project: Microsoft OneDrive

It seems that the inclusion of this library for this particular board type requires the following config in platformio.ini so that the preprocessor conditionals are evaluated:

lib_ldf_mode = chain+