Menuconfig without full rebuild

ethanbowering24
Posts: 4
Joined: Sat May 25, 2024 9:00 pm

Menuconfig without full rebuild

Postby ethanbowering24 » Wed May 21, 2025 5:01 pm

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?

nopnop2002
Posts: 362
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: Menuconfig without full rebuild

Postby nopnop2002 » Sat May 24, 2025 7:46 am

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);
}

Who is online

Users browsing this forum: DuckDuckGo [Bot], Google [Bot] and 1 guest