I was wondering how a (by custom-target) generated headerfile can be added to the build-sources.
I am outputting the headerfile in a custom directory in the $BUILD_DIR, from which I would like it to be included as a dependency/library.
As esp is using cmake, their system doesn’t communicate verry wel with platformio’s SCons implementation. so using filters/includes in the PIO-env will not work.
I hoped the env.BuildSources defenition as described in external resources documentation would help out, but that also doesn’t work unfortunately.
So is there a way to include an external source through an extra-script with esp? Preferably it should be added with intellisense as well.
But… headerfiles aren’t compiled to object files, so env.BuildSources will have 0 effect with regards to adding it to the build system or even include path.
Can you turn it around an generate a .c file that you can add with env.BuildSources that is reffered to by a static header?
It is true it won’t be compiled by itself. But shouldn’t it be implementable by regular .c/.cpp files? Right now I cannot use it (neither in intellisense nor in compilation). So as far as those files goes, they are invisible no matter what.
I tried it with the .c extension real quick, but that gave no different results unfortunately
Can you show a more detailed example of what file you generate? Intellisense might not take you to the .c implementation (because the build directory is not in env["CPPPATH"] but the build should succeed.