Skip to content

Commit 574968f

Browse files
committed
* Fix CMake PATH parser for Windows to handle parent folder paths correctly.
The build system encountered an error during compilation of the Esp32c3 (RISC-V) module on Windows. The issue was traced to incorrect handling of "/../" (parent folder path) in folder addresses within the "always-run-cargo.dummy-baee278.bat" file used by CMake. This fix resolves the issue, enabling successful compilation. Signed-off-by: Coskun Ergan <[email protected]>
1 parent 089d2ef commit 574968f

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ endfunction()
6060

6161
function(get_include_dirs target dirs)
6262
get_target_property(include_dirs ${target} INTERFACE_INCLUDE_DIRECTORIES)
63+
# normalited this path "/../"
6364
if(include_dirs)
65+
foreach(dir IN LISTS include_dirs)
66+
file(TO_CMAKE_PATH "${dir}" normalized_dir)
67+
file(REAL_PATH "${normalized_dir}" resolved_dir BASE_DIRECTORY "${CMAKE_SOURCE_DIR}")
68+
list(APPEND normalized_dirs "${resolved_dir}")
69+
endforeach()
70+
string(REPLACE ";" " " include_dirs "${normalized_dirs}")
6471
set(${dirs} "${include_dirs}" PARENT_SCOPE)
6572
else()
6673
set(${dirs} "" PARENT_SCOPE)

dt-rust.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
- "nordic,nrf51-flash-controller"
3838
- "raspberrypi,pico-flash-controller"
3939
- "zephyr,sim-flash"
40+
- "espressif,esp32-flash-controller"
41+
- "st,stm32-flash-controller"
4042
level: 0
4143
actions:
4244
- !Instance

zephyr-sys/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn main() -> Result<()> {
7676
.derive_copy(false)
7777
.allowlist_function("k_.*")
7878
.allowlist_function("gpio_.*")
79-
.allowlist_function("auxdisplay_.*")
79+
.allowlist_function("eeprom_.*")
8080
.allowlist_function("flash_.*")
8181
.allowlist_function("zr_.*")
8282
.allowlist_item("GPIO_.*")

zephyr-sys/wrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extern int errno;
4242
#include <zephyr/logging/log.h>
4343
#include <zephyr/bluetooth/bluetooth.h>
4444
#include <zephyr/drivers/flash.h>
45-
#include <zephyr/drivers/auxdisplay.h>
45+
#include <zephyr/drivers/eeprom.h>
4646
#include <zephyr/irq.h>
4747

4848
/*

0 commit comments

Comments
 (0)