From c7307de63ece94f7cbf147d7fc1a7d45b4a5f55f Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 1 May 2018 16:05:27 +1000 Subject: [PATCH] cmake: Automatically pull in winpty for menuconfig, monitor if needed --- tools/cmake/kconfig.cmake | 3 +++ tools/idf.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/tools/cmake/kconfig.cmake b/tools/cmake/kconfig.cmake index bda5c87bc..eeb8ce113 100644 --- a/tools/cmake/kconfig.cmake +++ b/tools/cmake/kconfig.cmake @@ -13,6 +13,7 @@ endmacro() if(CMAKE_HOST_WIN32) # Prefer a prebuilt mconf on Windows + find_program(WINPTY winpty) find_program(MCONF mconf) if(NOT MCONF) @@ -23,6 +24,8 @@ if(CMAKE_HOST_WIN32) "on the PATH, or an MSYS2 version of gcc on the PATH to build mconf. " "Consult the setup docs for ESP-IDF on Windows.") endif() + elseif(WINPTY) + set(MCONF "${WINPTY}" "${MCONF}") endif() endif() diff --git a/tools/idf.py b/tools/idf.py index 9064a8178..247fd3b9f 100755 --- a/tools/idf.py +++ b/tools/idf.py @@ -267,6 +267,8 @@ def monitor(action, args): monitor_args += [ "-p", args.port ] monitor_args += [ "-b", project_desc["monitor_baud"] ] monitor_args += [ elf_file ] + if "MSYSTEM" is os.environ: + monitor_args = [ "winpty" ] + monitor_args _run_tool("idf_monitor", monitor_args, args.build_dir)