Skip to content

Commit 9c3f958

Browse files
tejlmandmbolivar-nordic
authored andcommitted
[nrf fromlist] cmake: ensure zephyr_module.py creates posix path output
This commit fixes an issue in windows where zephyr_modules.txt contains a \ as path separator. This causes issues later when using the path generated by zephyr_module.txt are used as variables in CMake on windows. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent 98804da commit 9c3f958

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/zephyr_module.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ def process_module(module, cmake_out=None, kconfig_out=None):
8787
cmake_path = os.path.join(module, cmake_setting or 'zephyr')
8888
cmake_file = os.path.join(cmake_path, 'CMakeLists.txt')
8989
if os.path.isfile(cmake_file) and cmake_out is not None:
90-
cmake_out.write('\"{}\":\"{}\"\n'.format(os.path.basename(module),
91-
os.path.abspath(cmake_path)))
90+
cmake_out.write('\"{}\":\"{}\"\n'
91+
.format(os.path.basename(module), PurePath(
92+
os.path.abspath(cmake_path)).as_posix()))
9293

9394
kconfig_file = os.path.join(module, kconfig_setting or 'zephyr/Kconfig')
9495
if os.path.isfile(kconfig_file) and kconfig_out is not None:

0 commit comments

Comments
 (0)