From de261907323c3d588bf3520cf33fe6cfff563a2f Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Thu, 11 Sep 2025 08:42:21 +0200 Subject: [PATCH] fix(cmakev2/idf): target consistency check with sdkconfig Currently, the check is based on the existence of sdkconfig, but there may be situations where sdkconfig exists without containing CONFIG_IDF_TARGET. Perform a target consistency check only if the target is identified in the main sdkconfig file. Signed-off-by: Frantisek Hrbata --- tools/cmakev2/idf.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmakev2/idf.cmake b/tools/cmakev2/idf.cmake index 61bbe81874..986862c9a3 100644 --- a/tools/cmakev2/idf.cmake +++ b/tools/cmakev2/idf.cmake @@ -238,7 +238,7 @@ function(__init_idf_target) endif() # Verify that the chosen target aligns with the sdkconfig. - if(EXISTS "${sdkconfig}") + if(sdkconfig_target AND "${sdkconfig_file}" STREQUAL "${sdkconfig}") if("$ENV{_IDF_PY_SET_TARGET_ACTION}" STREQUAL "1") idf_dbg("The target consistency check for the target specified in ${sdkconfig} " "was skipped because the set-target action is being executed.")