Combine CMake Build System#237
Merged
Merged
Conversation
3020b79 to
a98119c
Compare
d713f91 to
c4b31f8
Compare
a98119c to
05b543a
Compare
05b543a to
ca20b9d
Compare
Add a check and error message in the esp-idf zcbor library wrapper that makes it more obvious when a build failed due to a missing submodule. Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
Clean up unknown config warning. This symbol is used in Zephyr but on ESP-IDF. Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
The example build command for using WiFi with the frdm_rw612 was missing the sysbuild flag. Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
CONFIG_NET_CONNECTION_MANAGER_CONNECTIVITY_WIFI_MGMT is unused in the coap and http samples. Remove from the extra wifi config to resolve warning. Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
Prepare for build system reorganization by making the Segmentation and Reassembly (SAR) system configurable via POUCH_TRANSPORT_SAR so that it may be built separately from gatt-related endpoint code. This is specifically needed for tests/pouch/transport, but SAR should also be available for future transport implementations besides gatt. Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
client.h was including pouch/pouch.h which in tern includes PSA crypto headers. These headers are not needed in the port transport files and were causing linking errors with ESP-IDF. Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
Consolidate the build system used by ESP-IDF and Zephyr, with an emphasis of using shared standard cmake as much as possible. The approach taken starts the build for both platforms in the root CMakeLists.txt, includes port-specific cmake files, then finishes the build using chains of add_subdirectory() calls. Code inclusion is guarded based on Kconfig symbols. Note that the gateway code is not yet cross-platform and has not been included in this work, but the existing build system for the gateway code remains stable. Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
This doesn't change behavior, but resolves build warnings like: Source file '/__w/pouch/pouch/tests/esp_idf/port/tests/test_msgq.c' belongs to component pouch but is being built by component main. Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
Remove POUCH_SERVER_CERT_MAX_LEN, POUCH_VALIDATE_SERVER_CERT, POUCH_SERVER_CERT_CN, and POUCH_CA_CERT_FILENAME definitions from port/zephyr/Kconfig. They are also defined in src/saead/Kconfig which is included via rsource in the same file. Signed-off-by: Mike Szczys <michael.szczys@canonical.com>
ca20b9d to
326c779
Compare
mniestroj
reviewed
Jun 25, 2026
| if(NOT _pouch_encryption_saead) | ||
| return() | ||
| endif() | ||
|
|
Collaborator
There was a problem hiding this comment.
In Zephyr we could probably do:
if (NOT CONFIG_POUCH_ENCRYPTION_SAEAD)
return()
endif()
Isn't that the case for ESP-IDF? I just wonder what value does pouch_config_enabled() bring.
Contributor
Author
There was a problem hiding this comment.
The problem I found is that ESP-IDF sets unselected symbols to "" (empty string):
build/config/sdkconfig.cmake
1486:set(CONFIG_POUCH_DELAYABLE_WORK "")
But in Zephyr the symbol is just not present. I added a helper function that differentiates and sets the true/false to deal with the issue.
mniestroj
approved these changes
Jun 26, 2026
trond-snekvik
approved these changes
Jun 26, 2026
trond-snekvik
left a comment
Collaborator
There was a problem hiding this comment.
Very clean!
Sorry for the delay on this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Centralize the build for both ESP-IDF and Zephyr to begin at the root CMakeLists.txt file. Include port-specific CMakeLists.txt files for port layer and transports. All common code is included in the using standard cmake (target_sources, etc) with add_subdirectory and Kconfig guards.
Add the idf_component.yml necessary to use this as a (publishable) ESP-IDF component.
Because the gateway code is not yet cross-platform, those cmake files were left untouched.
Manual testing
resolves: https://github.com/golioth/firmware-issue-tracker/issues/992
resolves: https://github.com/golioth/firmware-issue-tracker/issues/973