Skip to content

Commit

Permalink
cmake: scripts: add 'winpty' support when available
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
selescop authored and kartben committed Dec 12, 2024
1 parent 7019abb commit af9ae5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/modules/FindHostTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ find_program(BOSSAC bossac)
# in the mcuboot repository if that's present in some cases)
find_program(IMGTOOL imgtool)

# winpty is an optional dependency
find_program(PTY_INTERFACE winpty)
if("${PTY_INTERFACE}" STREQUAL "PTY_INTERFACE-NOTFOUND")
set(PTY_INTERFACE "")
endif()

# Default to the host system's toolchain if we are targeting a host based target
if((${BOARD_DIR} MATCHES "boards\/native") OR ("${ARCH}" STREQUAL "posix")
OR ("${BOARD}" STREQUAL "unit_testing"))
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/kconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ foreach(kconfig_target
"SHIELD_AS_LIST=${SHIELD_AS_LIST_ESCAPED}"
DTS_POST_CPP=${DTS_POST_CPP}
DTS_ROOT_BINDINGS=${DTS_ROOT_BINDINGS}
${PTY_INTERFACE}
${PYTHON_EXECUTABLE}
${EXTRA_KCONFIG_TARGET_COMMAND_FOR_${kconfig_target}}
${KCONFIG_ROOT}
Expand Down

0 comments on commit af9ae5b

Please sign in to comment.