Menuconfig without full rebuild
Posted: Wed May 21, 2025 5:01 pm
by ethanbowering24
Is there a way to run menuconfig without a full rebuild? I need to flash a bunch of devices and change a parameter that I have configured through menuconfig each time, however this triggers a full rebuild even when I change one value. I can just go change it in the source code manually but I wanted to know if there was another way/best practice?
Re: Menuconfig without full rebuild
Posted: Sat May 24, 2025 7:46 am
by nopnop2002
An imperfect workaround is to use CMAKE_C_FLAGS in CMakeLists.txt.
Code: Select all
set(component_srcs "main.c")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D ENABLE_MBEDTLS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D ENABLE_CJSON")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D VALUE=64")
idf_component_register(SRCS "${component_srcs}" INCLUDE_DIRS ".")
Code: Select all
#include <stdio.h>
#include <mbedtls/version.h>
#include <cJSON.h>
void app_main(void)
{
#ifdef ENABLE_CJSON
printf("cJSON_Version:%s\n", cJSON_Version());
#endif
#ifdef ENABLE_MBEDTLS
printf("MBEDTLS_VERSION_STRING=%s\n", MBEDTLS_VERSION_STRING);
#endif
printf("VALUE=%d\n", VALUE);
}