Skip to content

Commit 351d5c8

Browse files
committed
Change windows escaping
1 parent 633fb6e commit 351d5c8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ports/zephyr-cp/cptools/cpbuild.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,14 @@ def __init__(self, srcdir: pathlib.Path, builddir: pathlib.Path, cmake_args):
324324
self.c_compiler = cmake_args["CC"]
325325
self.ar = cmake_args["AR"]
326326
self.cflags = cmake_args.get("CFLAGS", "")
327-
print(self.cflags)
328327

329328
self._cflags_tempfile = tempfile.NamedTemporaryFile()
330329

331-
# Windows paths have \ as separator but ar wants them as / (like UNIX)
332-
unix_cflags = self.cflags.replace("\\", "/")
333-
self._cflags_tempfile.write(unix_cflags.encode())
330+
# Windows paths have \ as separator but gcc wants them escaped.
331+
escaped_cflags = self.cflags.replace("\\", "\\\\")
332+
print("writing:")
333+
print(escaped_cflags)
334+
self._cflags_tempfile.write(escaped_cflags.encode())
334335
self._cflags_tempfile.flush()
335336
self.cflags_file = "@" + self._cflags_tempfile.name
336337

0 commit comments

Comments
 (0)