Skip to content

LDF doesn't resolve dependencies in (+) modes if an intermediate header file is located outside lib folders #4818

Open
@valeros

Description

@valeros

Description of problem

LDF (in any mode that evaluates C/C++ Preprocessor conditional syntax) is not able to find a dependency when a header from that dependency is hidden under an ifdef guard and the macro that enables the include header file is located outside search paths (framework libraries, include and src folders) passed to CCONDITIONAL_SCANNER,

For example the CONFIG_ETH_ENABLED macro in the code below is set in the sdkconfig.h file which is located in the framework folder $PIO_PACKAGES/framework-arduinoespressif32/tools/sdk/esp32/dio_qspi/include.

Steps to Reproduce

Compile the following code:

#include <Arduino.h>
#include <sdkconfig.h>

#ifdef CONFIG_ETH_ENABLED
#include "ETH.h"
#endif

void setup() {}

void loop() {}

with the following configuration:

[env:esp32dev]
platform = espressif32
framework = arduino
board = esp32dev
lib_ldf_mode = deep+

Actual Results

Scanning dependencies...
No dependencies
Compiling .pio\build\esp32dev\src\main.cpp.o
src/main.cpp:25:10: fatal error: ETH.h: No such file or directory

Expected Results

Scanning dependencies...
Dependency Graph
|-- Ethernet @ 2.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    LDFLibrary Dependency Finderbug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions