platformio-core icon indicating copy to clipboard operation
platformio-core copied to clipboard

include path when using external directory with env.BuildSources()

Open EvEggelen opened this issue 6 months ago • 0 comments

I tried to put some source code outside the src folder (cpp/c files) when building an ESP IDF project ( platform = espressif32, framework = espidf ). To add the files that need building I used the examples/link below. The files are build, but I noticed that the include path is different than files build from the src folder. When I try to include header files from cpp files in this external directly, header files from the included libraries are not found ( e.g. lib_deps = ArduinoJson ). Standard library files seems to be found. Also the header files from the lib_deps are found when included from the cpp files inside the src dir.

Is this intentional ? How can I include header files from my lib_deps in this external directory ?

https://docs.platformio.org/en/latest/scripting/examples/external_sources.html

import os

Import("env")

env.BuildSources(
    os.path.join("$BUILD_DIR", "external", "build"),
    os.path.join("$PROJECT_DIR", "external", "sources")
)

EvEggelen avatar Jun 26 '25 16:06 EvEggelen