Page 1 of 1

how to update build copy of IDF files?

Posted: Mon Aug 12, 2019 6:38 pm
by mzimmers
Hi all -

I've been asked to add an HTTP server to our application. My build directory in my application seems to be missing some files that are present in the IDF. I'm not sure what happened, but can someone remind me how to update the copy of the IDF components I have in my build directory?

Thanks...

EDIT: I tried deleting the "build" subdirectory from my project, and running make again. The subdirectory regenerated, but I still had files that were different from what I was expecting. What am I doing wrong?
Image
Image

Re: how to update build copy of IDF files?

Posted: Tue Aug 13, 2019 5:35 am
by ESP_Angus
Hi mzimmers,

Not sure I fully understand your question, sorry. The "build" directory contains build output from the build system and compiler while building the project. Source files are generally not copied from the IDF_PATH directory to the build directory, instead the source files are compiled into object files and libraries in the build directory.

Does that shed some light? If not, can you please explain in detail exactly which files you expect to see in the build directory which aren't there?

Re: how to update build copy of IDF files?

Posted: Tue Aug 13, 2019 1:56 pm
by mzimmers
Hi Angus -

I'd forgotten that the build directory doesn't contain source files. The file I want to use is esp_http_server.h from esp_http_server/include. I notice that it's not in $IDF_PATH/components/esp32/include. It's been so long since I added a component to my programs that I don't remember how to do it. Do I just copy the header file to this directory?

Thanks...

EDIT: I did a bit more snooping, to try to knock the rust off my memory. I guess somehow, make magically finds all the include files in the IDF. So, I removed the pathname portion of my #include directive and it found the file. I'm still not sure I know how it does this, but it builds.

On a side note, I use Qt Creator as my code editor and browser, and a code model enforcer. It couldn't find the enums for HTTP_GET, HTTP_POST, etc. so I went looking for them, and I couldn't find them anywhere either, but...the build succeeds. Where are these defined?

Re: how to update build copy of IDF files?

Posted: Wed Aug 14, 2019 1:29 am
by ESP_Angus
mzimmers wrote:
Tue Aug 13, 2019 1:56 pm
EDIT: I did a bit more snooping, to try to knock the rust off my memory. I guess somehow, make magically finds all the include files in the IDF. So, I removed the pathname portion of my #include directive and it found the file. I'm still not sure I know how it does this, but it builds.
The ESP-IDF build system automatically adds all of the include paths for used components when it runs the compiler.

If you're using CMake, note that components in CMake need to declare which other components they depend on - otherwise the paths for these components won't be passed to the compiler.
mzimmers wrote:
Tue Aug 13, 2019 1:56 pm
On a side note, I use Qt Creator as my code editor and browser, and a code model enforcer. It couldn't find the enums for HTTP_GET, HTTP_POST, etc. so I went looking for them, and I couldn't find them anywhere either, but...the build succeeds. Where are these defined?
Defined here:
https://github.com/espressif/esp-idf/bl ... rser.h#L98

As you can see, the header uses some C preprocessor magic to generate the full HTTP_POST symbol name. If Qt Creator is not running the header files through the preprocessor, it won't be able to recognize the symbol name.