Fix CMake PATH parser for Windows #100
Open
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.
Description
This pull request addresses a compilation error encountered when building the Esp32c3 (RISC-V) module on Windows using the CMake build system. The issue originated from improper handling of parent folder paths (
/../
) in folder addresses specified within thealways-run-cargo.dummy-baee278.bat
file, which is utilized by CMake during the build process.Problem
The build system failed during compilation of the Esp32c3 module on Windows due to improper resolution of paths containing /../ in always-run-cargo.dummy-baee278.bat and the get_include_dirs function in CMakeLists.txt. These paths caused CMake to misinterpret directory references, resulting in build failures.
Examples of problematic paths include:
C:/zephyr/zephyrproject/modules/hal/espressif/zephyr/esp32c3/../esp_shared/include
C:/zephyr/zephyrproject/modules/hal/espressif/zephyr/esp32c3/../esp_shared/components/include
C:/zephyr/zephyrproject/modules/hal/espressif/zephyr/esp32c3/../../components/efuse/include
The correct paths should be:
C:/zephyr/zephyrproject/modules/hal/espressif/zephyr/esp_shared/include
C:/zephyr/zephyrproject/modules/hal/espressif/zephyr/esp_shared/components/include
C:/zephyr/zephyrproject/modules/hal/espressif/components/efuse/include
Solution
This fix updates always-run-cargo.dummy-xxx.bat to use fully resolved paths and modifies the get_include_dirs function in CMakeLists.txt to properly handle /../ paths, ensuring CMake can accurately locate the necessary directories. These changes enable successful compilation of the Esp32c3 module on Windows.