]> granicus.if.org Git - esp-idf/commitdiff
cmake: Automatically pull in winpty for menuconfig, monitor if needed
authorAngus Gratton <angus@espressif.com>
Tue, 1 May 2018 06:05:27 +0000 (16:05 +1000)
committerAngus Gratton <gus@projectgus.com>
Tue, 1 May 2018 07:27:39 +0000 (17:27 +1000)
tools/cmake/kconfig.cmake
tools/idf.py

index bda5c87bcd5443e8d4d76b571077b34e3184dbd1..eeb8ce11398266afb0d00a21a65b54934b5685fb 100644 (file)
@@ -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()
 
index 9064a81783051926743052806a93cb634ede7c8c..247fd3b9fdfcc18b50f74565f923ffada9e74e60 100755 (executable)
@@ -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)