Skip to content

Commit 4334644

Browse files
committed
Try escaped backslashes
1 parent bdafc7b commit 4334644

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ports/zephyr-cp/cptools/cpbuild.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,11 @@ def __init__(self, srcdir: pathlib.Path, builddir: pathlib.Path, cmake_args):
327327

328328
self._cflags_tempfile = tempfile.NamedTemporaryFile()
329329

330-
# Windows paths have \ as separator but gcc wants them escaped.
331-
escaped_cflags = self.cflags.replace("\\", "\\\\")
330+
# Windows paths have / as separator but gcc wants them as escaped backslashes.
331+
if os.name == "nt":
332+
escaped_cflags = self.cflags.replace("/", "\\\\")
333+
else:
334+
escaped_cflags = self.cflags
332335
print("writing:")
333336
print(escaped_cflags)
334337
self._cflags_tempfile.write(escaped_cflags.encode())

0 commit comments

Comments
 (0)