]> granicus.if.org Git - esp-idf/commitdiff
cmake: Fix Windows issue running menuconfig in Command Prompt if winpty on Path
authorAngus Gratton <gus@projectgus.com>
Wed, 17 Oct 2018 07:15:41 +0000 (18:15 +1100)
committerAngus Gratton <gus@projectgus.com>
Wed, 17 Oct 2018 22:56:16 +0000 (09:56 +1100)
Previous version assumed having winpty on the Path meant that it would be needed,
but some tools (like Atlassian Sourcetree) permanently add winpty to the path.

Symptom is arrow keys not working in menuconfig dialog.

tools/cmake/kconfig.cmake

index 4eb132d966551cda7909c5fcd3ccb55eb11b4bb4..aad91c10dcb39c194a1bd199e68ca65fde3c0621 100644 (file)
@@ -18,7 +18,11 @@ endmacro()
 
 if(CMAKE_HOST_WIN32)
     # Prefer a prebuilt mconf-idf on Windows
-    find_program(WINPTY winpty)
+    if(DEFINED ENV{MSYSTEM})
+        find_program(WINPTY winpty)
+    else()
+        unset(WINPTY CACHE)  # in case previous CMake run was in a tty and this one is not
+    endif()
     find_program(MCONF mconf-idf)
 
     # Fall back to the old binary which was called 'mconf' not 'mconf-idf'