Skip to content

Commit af9ae5b

Browse files
selescopkartben
authored andcommitted
cmake: scripts: add 'winpty' support when available
Some Python scripts need to access to the underlying OS, like using redirections. These interactions go through TTY interface. On MinGW, these interactions/interfaces are called 'winpty'. => use them when available (harmless on platform *NIX platforms) Signed-off-by: Cedric Lescop <[email protected]>
1 parent 7019abb commit af9ae5b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cmake/modules/FindHostTools.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ find_program(BOSSAC bossac)
6565
# in the mcuboot repository if that's present in some cases)
6666
find_program(IMGTOOL imgtool)
6767

68+
# winpty is an optional dependency
69+
find_program(PTY_INTERFACE winpty)
70+
if("${PTY_INTERFACE}" STREQUAL "PTY_INTERFACE-NOTFOUND")
71+
set(PTY_INTERFACE "")
72+
endif()
73+
6874
# Default to the host system's toolchain if we are targeting a host based target
6975
if((${BOARD_DIR} MATCHES "boards\/native") OR ("${ARCH}" STREQUAL "posix")
7076
OR ("${BOARD}" STREQUAL "unit_testing"))

cmake/modules/kconfig.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ foreach(kconfig_target
226226
"SHIELD_AS_LIST=${SHIELD_AS_LIST_ESCAPED}"
227227
DTS_POST_CPP=${DTS_POST_CPP}
228228
DTS_ROOT_BINDINGS=${DTS_ROOT_BINDINGS}
229+
${PTY_INTERFACE}
229230
${PYTHON_EXECUTABLE}
230231
${EXTRA_KCONFIG_TARGET_COMMAND_FOR_${kconfig_target}}
231232
${KCONFIG_ROOT}

0 commit comments

Comments
 (0)