Library.json for Different Platforms

I’m curious. Say you have a library that supports espressif32 and espressif8266. But for espressif8266 you don’t need a particular .c file to be built and need it excluded. Can this be done?

Also, am I correct in saying a project uses platformio.ini to do include/exclude/flags, but libraries use library.json?

You need to dynamically configure SRC_FILTER using extra script. See Redirecting...