Skip to content

Commit

Permalink
[nrf fromtree] scripts: snippets: Fix path output on windows
Browse files Browse the repository at this point in the history
Fixes an issue with paths being output in windows-style with back
slashes, this causes issues for certain escape sequences when
cmake interprets them. Replace these paths with posix paths so
that they are not treated as possible escape sequences.

Signed-off-by: Jamie McCrae <[email protected]>
(cherry picked from commit b680a6e)
  • Loading branch information
nordicjm authored and PerMac committed Apr 10, 2024
1 parent 76c76ed commit 9209551
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def append_value(variable, value):
path = pathobj.parent / value
if not path.is_file():
_err(f'snippet file {pathobj}: {variable}: file not found: {path}')
return f'"{path}"'
return f'"{path.as_posix()}"'
if variable in ('DTS_EXTRA_CPPFLAGS'):
return f'"{value}"'
_err(f'unknown append variable: {variable}')
Expand Down

0 comments on commit 9209551

Please sign in to comment.