Skip to content

Commit c036a57

Browse files
committed
UNIX style slashes in cflags file
1 parent 8dfe0c8 commit c036a57

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ports/zephyr-cp/cptools/cpbuild.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,13 @@ 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)
327328

328329
self._cflags_tempfile = tempfile.NamedTemporaryFile()
329-
self._cflags_tempfile.write(self.cflags.encode())
330+
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())
330334
self._cflags_tempfile.flush()
331335
self.cflags_file = "@" + self._cflags_tempfile.name
332336

0 commit comments

Comments
 (0)