Browse Source

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 <cedric.lescop@se.com>
pull/76136/head
Cedric Lescop 7 months ago committed by Benjamin Cabé
parent
commit
af9ae5b894
  1. 6
      cmake/modules/FindHostTools.cmake
  2. 1
      cmake/modules/kconfig.cmake

6
cmake/modules/FindHostTools.cmake

@ -65,6 +65,12 @@ find_program(BOSSAC bossac) @@ -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"))

1
cmake/modules/kconfig.cmake

@ -226,6 +226,7 @@ foreach(kconfig_target @@ -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}

Loading…
Cancel
Save