feat: Adopt cmake for project build system generation#5
Conversation
👋 Hello dobairoland, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
3c19780 to
b1c25d4
Compare
69afeb3 to
a8248eb
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new "How to Build" section in the README.md to guide users in building the project with CMake and Ninja.
- Added instructions to initialize the esp-stub-lib submodule.
- Provided CMake and Ninja command-line steps for generating and building the project.
Files not reviewed (3)
- CMakeLists.txt: Language not supported
- src/ld/esp32.ld: Language not supported
- src/main.cpp: Language not supported
5fc41f5 to
ba4bd1e
Compare
e1df9eb to
5488504
Compare
There was a problem hiding this comment.
Copilot reviewed 9 out of 15 changed files in this pull request and generated 1 comment.
Files not reviewed (6)
- CMakeLists.txt: Language not supported
- src/CMakeLists.txt: Language not supported
- src/ld/esp32.ld: Language not supported
- tools/build_all_chips.sh: Language not supported
- tools/export_toolchains.sh: Language not supported
- tools/setup_toolchains.sh: Language not supported
2ea5c1d to
92f6a46
Compare
21feabf to
3d1871c
Compare
There was a problem hiding this comment.
Copilot reviewed 9 out of 15 changed files in this pull request and generated 1 comment.
Files not reviewed (6)
- CMakeLists.txt: Language not supported
- src/CMakeLists.txt: Language not supported
- src/ld/esp32.ld: Language not supported
- tools/build_all_chips.sh: Language not supported
- tools/export_toolchains.sh: Language not supported
- tools/setup_toolchains.sh: Language not supported
0109c8e to
1b40bd5
Compare
1b40bd5 to
22f01ca
Compare
There was a problem hiding this comment.
Copilot reviewed 8 out of 16 changed files in this pull request and generated no comments.
Files not reviewed (8)
- CMakeLists.txt: Language not supported
- src/CMakeLists.txt: Language not supported
- src/ld/esp32-c3.ld: Language not supported
- src/ld/esp32.ld: Language not supported
- src/ld/esp8266.ld: Language not supported
- tools/build_all_chips.sh: Language not supported
- tools/export_toolchains.sh: Language not supported
- tools/setup_toolchains.sh: Language not supported
Comments suppressed due to low confidence (1)
.github/workflows/build_and_release.yml:86
- Ensure the artifact path 'artifact/esp*.json' matches the output from the build step, which uses 'build*/esp*.json'. Align these paths to avoid missing files during release.
files: artifact/esp*.json
22f01ca to
d9cc956
Compare
erhankur
left a comment
There was a problem hiding this comment.
@dobairoland left some comments.
|
|
||
| project(flasher-stub CXX) | ||
|
|
||
| option(TARGET_CHIP "Target ESP chip" "OFF") |
There was a problem hiding this comment.
If there are no change requests in the review of the initial structure, esp-stub-lib will require the variable ESP_TARGET for the same purpose.
There was a problem hiding this comment.
If I understood your comment correctly then probably there will be a clash. I think we can address this as part of the follow-up task (#8).
We will adjust this project based on espressif/esp-stub-lib#3. No need to do it the other way.
| get_target_property(comp_opts esp8266 COMPILE_OPTIONS) | ||
| list(REMOVE_ITEM comp_opts -Wconversion) | ||
|
|
||
| add_library(miniz_obj OBJECT miniz.cpp) |
There was a problem hiding this comment.
I think you can remove miniz files.
OpenOCD will also need zlib library. You will be able to call it from the library.
There was a problem hiding this comment.
Thank you for pointing this out. I added a comment here for the future.
I'd like to keep this for now. It took me a while to figure out how to change the flags for source files individually. I'd like to keep it here as example. We will try to keep miniz for now, test the new stub and then possible switch if it will be reasonably. But it is also possible that we will keep using miniz until the approaching end-of-life of ESP8266 as the stub for it rarely needs update these days.
| #!/usr/bin/env bash | ||
|
|
||
| TO_DOWNLOAD=( | ||
| "https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/xtensa-esp-elf-14.2.0_20241119-x86_64-linux-gnu.tar.xz" |
There was a problem hiding this comment.
Why don't we suggest to use esp-idf environment for newer chips? Most probably all tools will be already installed.
There was a problem hiding this comment.
I'm leaving this open for others to see and comment.
My reasons were:
- It was good enough and had low maintenance so far. We just replaced the link time-to-time and were not forced to update every time ESP-IDF did adopt a new toolchain. This helped to track size and see the changes related to only the change of our sources. Automated change of toolchain will break our pipelines comparing the flasher binaries included inside esptool (new warnings, new flags, etc.).
- It doesn't suggest to use anything from ESP-IDF.
- The environment is clean and simple.
There was a problem hiding this comment.
Sounds reasonable. Thanks for the explanation.
d9cc956 to
07a2940
Compare
|
@erhankur Thank you for your useful comments. I tried to address all of them. |
|
Hi @dobairoland , in general LGTM as something we can start with. I'm not sure if we need to keep the separate |
|
@fhrbata Thank you for taking a look.
We can remove it later. At this point I'm not sure how complex will be the content of
I agree on that. In the earlier versions I attempted that and even made cmake download the toolchains. But it was a mess and I simplified it to the current state. |
07a2940 to
a812780
Compare
erhankur
left a comment
There was a problem hiding this comment.
@dobairoland thanks for addressing and answering my comments. LGTM
Uh oh!
There was an error while loading. Please reload this page.