Skip to content

Commit c0c8542

Browse files
committed
py/mkrules: Fix pipe command failure on windows.
Piped commands fail when forward slash is used with executable. For example: `echo a | C:/gcc/bin/gcc.exe` fails with the following error: 'C:' is not recognized as an internal or external command, operable program or batch file. Converting path to backslash avoids the error. Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
1 parent 810dfaa commit c0c8542

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

py/mkrules.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ set(MICROPY_ROOT_POINTERS_COLLECTED "${MICROPY_GENHDR_DIR}/root_pointers.collect
1616
set(MICROPY_ROOT_POINTERS "${MICROPY_GENHDR_DIR}/root_pointers.h")
1717

1818
if(CMAKE_HOST_WIN32)
19+
# On Windows piped commands fail when forward slash is used with executable.
20+
#
21+
# For example: `echo a | C:/gcc/bin/gcc.exe` fails with the following error:
22+
# 'C:' is not recognized as an internal or external command, operable program or batch file.
23+
# Converting path to backslash avoids the error.
24+
string(REGEX REPLACE "/" "\\\\" CMAKE_C_COMPILER ${CMAKE_C_COMPILER})
1925
# CMD requires additional escapes for CMD
2026
set(MICROPY_QSTRDEFS_PREPROCESS_SED0 "s/^^Q(.*)/\"^&\"/")
2127
set(MICROPY_QSTRDEFS_PREPROCESS_SED1 "s/^^\\\"\\(Q(.*)\\)\\\"/\\1/")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy