cmake: convert path to CMake style before writing Kconfig files

Fixes: #68667

Kconfig is not fond of mixed path separators, therefore ensure CMake
style path is used in generated Kconfig files. CMake path style uses
`/`, and thus ensures correct behavior in Kconfig.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen
2024-02-07 09:23:51 +01:00
committed by Jamie McCrae
parent 9c4ac6a202
commit 14d2b955da

View File

@@ -27,6 +27,7 @@ function(kconfig_gen bin_dir file dirs)
file(MAKE_DIRECTORY "${bin_dir}")
set(kconfig_file ${bin_dir}/${file})
foreach(dir ${dirs})
cmake_path(CONVERT "${dir}" TO_CMAKE_PATH_LIST dir)
file(APPEND ${kconfig_file} "osource \"${dir}/${file}\"\n")
endforeach()
endfunction()