PlatformIO Community

Problems with nested libraries structure and understanding LDF

This is the actual library structure:

├── lib
│ ├── comm_manager
│ │ ├── comm_dispatcher
│ │ ├── comm_driver
│ │ └── library.json
│ ├── common_libs
│ │ ├── arduino_etl
│ │ ├── arduino_stl
│ │ ├── geometry_math
│ │ ├── nonstd
│ │ └── user_interface
│ ├── driver_manager
│ │ ├── driver_motor_manager
│ │ ├── driver_position_manager
│ │ └── library.json
│ └── path_manager
│ ├── flow_node.h
│ ├── library.json
│ └── proccess_nodes.h

the lib folder is outside of the project to share the libraries with other projects

common_libs is added to platformio.ini to env section
lib_extra_dirs =
…/…/lib/common_libs

path_manager/flow_node.h includes file locating in arduino_etl/include/etl/unordered_map.h

if I place arduino_etl in lib root directory, it finds includes of arduino_etl with no problem, if I place it to common_libs it does not find the files in etl/ include folder anymore.

If I write in platformio.ini in env section this: lib_ldf_mode = deep+, it compiles again, but takes longer to search all the deps.

path_manager has a library.json also with a deep+ flag and includeDir set to “./”, but it does not help.

If I place arduino_etl again in common_libs and add to flow_node.h this include:
#include <arduino_etl/include/etl/unordered_map.h it finds again the file. But it does not find all other includes that are referenced in unordered_map.

I want arduino_etl in common_libs and including in any library header file like this:
#include <etl/unordered_map.h>

Actually I have still problem to understand how the library dependecy finder works. I have read the docs up and down but still strugling on this question.

Thank you!

Actually the solution was properly define dependencies in library.json of path_manager package

{
    "name": "path_manager",
    "version": "0.38",
    "dependencies" : {
        "comm_manager": "0.38",
        "Embedded Template Library": "14.35.2"
    },
    "build": {
       "srcDir": "./",
       "includeDir": "./"
    }
}

It seems that declared dependencies are included into search path of the compiler, without global deep+ in platformio.ini