Custom library exclude problem

Hi

So I have a git-repo with quite a lot of sensor drivers which I add as a submodule into new projects.
Up till now I used STM32CubeIDE with STM32. There I could just exclude folders from building.

In PlatformIO I can’t seem to get it working.

My .ini file:

[env:bc66]
platform = quectel
board = bc66
framework = opencpu
upload_port = COM4
upload_speed = 460800
monitor_port = COM4
monitor_speed = 115200
board_build.disable_nano = 0
board_build.firmware = BC66R01A10

lib_deps = 
  SHT40
  MBED_JSON
  BMI160

lib_ignore = 
  ADE7913
  lwmqtt
  mbedtls
  mqtt-sn
  LIS2DE12
  MCP9808
  Si7006
  SHT30
  W25QXX
  ASYNCH

...
Compiling .pio/build/bc66/_ril/ril_network.o
Compiling .pio/build/bc66/_ril/ril_sim.o
Compiling .pio/build/bc66/_ril/ril_socket.o
Compiling .pio/build/bc66/_ril/ril_system.o
Compiling .pio/build/bc66/_ril/ril_urc.o
Compiling .pio/build/bc66/_ril/ril_util.o
Compiling .pio/build/bc66/_custom_lib/ADE7913/ade7913.o
Compiling .pio/build/bc66/_custom_lib/ADE7913/ade7913_reg.o
...

This _custom_lib includes all libraries. including the excluded ones.
Every time I build, PlatformIO also compiles the excluded libraries which throws a bunch of errors. Most of those libraries are purpose-built for STM, but I also want to get rid of the unnecessary compiling time

Thanks in advance!

Well if I read this correctly the library name is _custom_lib and it has all the subfolders with all drivers? Then _custom_lib is one “library” and you cannot ignore subfolders in the library with lib_ignore directives since the subfolders are not libraries themselves – only _custom_lib is, as a whole.

Either restructure your library folder so that every driver is it’s own library on the highest level, or add a library.json to the _custom_lib and use a static srcFilter attributes to ignore certain subfolders, or use the extraScript attribute with a litte bit of python code to dynamically turn compiling libraries on / off by buiding the SRC_FILTER value on the fly. The docs has a good example of this.

there is no folder/library or any inclusion for _custom_lib.
All drivers are located in their own folder directly in the lib folder. They also all got their own library.json. Nothing fancy, but just naming the library, author and revision.

My compiling log looks like the following. The SHT40 is an included library. But the ADE7913 is ignored in platformio.ini.

Indexing .pio/build/bc66/lib609/libSHT40.a
Indexing .pio/build/bc66/lib8ab/libMBED_JSON.a
Compiling .pio/build/bc66/_ril/ril_atResponse.o
Compiling .pio/build/bc66/_ril/ril_dfota.o
Compiling .pio/build/bc66/_ril/ril_init.o
Compiling .pio/build/bc66/_ril/ril_lwm2m.o
Archiving .pio/build/bc66/libe5c/libIOX_LOG.a
Archiving .pio/build/bc66/libfe7/libSCD40.a
Indexing .pio/build/bc66/libe5c/libIOX_LOG.a
Archiving .pio/build/bc66/libc7e/libSGP40.a
Indexing .pio/build/bc66/libfe7/libSCD40.a
Indexing .pio/build/bc66/libc7e/libSGP40.a
Compiling .pio/build/bc66/_ril/ril_mqtt.o
Compiling .pio/build/bc66/_ril/ril_network.o
Compiling .pio/build/bc66/_ril/ril_sim.o
Compiling .pio/build/bc66/_ril/ril_socket.o
Compiling .pio/build/bc66/_ril/ril_system.o
Compiling .pio/build/bc66/_ril/ril_urc.o
Compiling .pio/build/bc66/_ril/ril_util.o
Compiling .pio/build/bc66/_custom_lib/ADE7913/ade7913.o
Compiling .pio/build/bc66/_custom_lib/ADE7913/ade7913_reg.o

Can you show a tree structure of where that file is located?