From 5034a57605ba22241abad989d38120a241607eb2 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 27 May 2019 17:50:31 +0200 Subject: [PATCH] Tools: Fix CMake menuconfig used with combination of MSYS and CMD --- tools/cmake/kconfig.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/cmake/kconfig.cmake b/tools/cmake/kconfig.cmake index 63914a1c0..020e59550 100644 --- a/tools/cmake/kconfig.cmake +++ b/tools/cmake/kconfig.cmake @@ -9,6 +9,7 @@ function(__kconfig_init) else() unset(WINPTY CACHE) # in case previous CMake run was in a tty and this one is not endif() + unset(MCONF CACHE) # needed when MSYS and CMD is intermixed (cache could contain an incompatible path) find_program(MCONF mconf-idf) # Fall back to the old binary which was called 'mconf' not 'mconf-idf' @@ -30,7 +31,7 @@ function(__kconfig_init) "Consult the setup docs for ESP-IDF on Windows.") endif() elseif(WINPTY) - set(MCONF "${WINPTY}" "${MCONF}") + set(MCONF "\"${WINPTY}\" \"${MCONF}\"") endif() endif() @@ -201,7 +202,8 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults) "IDF_CMAKE=y" "KCONFIG_CONFIG=${sdkconfig}" ${mconf} ${root_kconfig} - VERBATIM + # VERBATIM cannot be used here because it cannot handle ${mconf}="winpty mconf-idf" and the escaping must be + # done manually USES_TERMINAL # additional run of confgen esures that the deprecated options will be inserted into sdkconfig (for backward # compatibility)