From 2f4079ebb2237c646ef49f9dd7e96a7c9552a098 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Mon, 7 May 2018 10:01:16 +0800 Subject: [PATCH] cmake: Hide serial port settings in menuconfig when using cmake --- Kconfig | 3 +++ components/esptool_py/Kconfig.projbuild | 4 ++++ make/project_config.mk | 1 + tools/cmake/kconfig.cmake | 4 +++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Kconfig b/Kconfig index ac8a1db950..75606aa4ff 100644 --- a/Kconfig +++ b/Kconfig @@ -4,6 +4,9 @@ # mainmenu "Espressif IoT Development Framework Configuration" +config IDF_CMAKE + bool + option env="IDF_CMAKE" menu "SDK tool configuration" config TOOLPREFIX diff --git a/components/esptool_py/Kconfig.projbuild b/components/esptool_py/Kconfig.projbuild index c87d8adcf1..e34d577597 100644 --- a/components/esptool_py/Kconfig.projbuild +++ b/components/esptool_py/Kconfig.projbuild @@ -2,6 +2,7 @@ menu "Serial flasher config" config ESPTOOLPY_PORT string "Default serial port" + depends on !IDF_CMAKE default "/dev/ttyUSB0" help The serial port that's connected to the ESP chip. This can be overridden by setting the ESPPORT @@ -11,6 +12,7 @@ config ESPTOOLPY_PORT choice ESPTOOLPY_BAUD prompt "Default baud rate" + depends on !IDF_CMAKE default ESPTOOLPY_BAUD_115200B help Default baud rate to use while communicating with the ESP chip. Can be overridden by @@ -36,6 +38,7 @@ config ESPTOOLPY_BAUD_OTHER_VAL config ESPTOOLPY_BAUD int + depends on !IDF_CMAKE default 115200 if ESPTOOLPY_BAUD_115200B default 230400 if ESPTOOLPY_BAUD_230400B default 921600 if ESPTOOLPY_BAUD_921600B @@ -44,6 +47,7 @@ config ESPTOOLPY_BAUD config ESPTOOLPY_COMPRESSED bool "Use compressed upload" + depends on !IDF_CMAKE default "y" help The flasher tool can send data compressed using zlib, letting the ROM on the ESP chip diff --git a/make/project_config.mk b/make/project_config.mk index 8f0006c795..613b203f78 100644 --- a/make/project_config.mk +++ b/make/project_config.mk @@ -43,6 +43,7 @@ define RunConf cd $(BUILD_DIR_BASE); KCONFIG_AUTOHEADER=$(abspath $(BUILD_DIR_BASE)/include/sdkconfig.h) \ COMPONENT_KCONFIGS="$(COMPONENT_KCONFIGS)" KCONFIG_CONFIG=$(SDKCONFIG) \ COMPONENT_KCONFIGS_PROJBUILD="$(COMPONENT_KCONFIGS_PROJBUILD)" \ + IDF_CMAKE=n \ $(KCONFIG_TOOL_DIR)/$1 $(IDF_PATH)/Kconfig endef diff --git a/tools/cmake/kconfig.cmake b/tools/cmake/kconfig.cmake index eeb8ce1139..10894f6ad4 100644 --- a/tools/cmake/kconfig.cmake +++ b/tools/cmake/kconfig.cmake @@ -83,7 +83,8 @@ function(kconfig_process_config) ${defaults_arg} --create-config-if-missing --env "COMPONENT_KCONFIGS=${kconfigs}" - --env "COMPONENT_KCONFIGS_PROJBUILD=${kconfigs_projbuild}") + --env "COMPONENT_KCONFIGS_PROJBUILD=${kconfigs_projbuild}" + --env "IDF_CMAKE=y") # Generate the menuconfig target (uses C-based mconf tool, either prebuilt or via mconf target above) add_custom_target(menuconfig @@ -93,6 +94,7 @@ function(kconfig_process_config) COMMAND ${CMAKE_COMMAND} -E env "COMPONENT_KCONFIGS=${kconfigs}" "COMPONENT_KCONFIGS_PROJBUILD=${kconfigs_projbuild}" + "IDF_CMAKE=y" "KCONFIG_CONFIG=${SDKCONFIG}" ${MCONF} ${ROOT_KCONFIG} VERBATIM -- 2.40.0