From db91c7d847436b55acd3b97fad42967079504ce6 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Fri, 17 Apr 2026 08:38:37 +0200 Subject: [PATCH] fix(cmakev2): respect explicit SET_COMPILER_OPTIMIZATION values Use a DEFINED check instead of a truthy check so explicit NO/OFF/FALSE values are honored. --- tools/cmakev2/project.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmakev2/project.cmake b/tools/cmakev2/project.cmake index ae7816b9ce5..432f4282661 100644 --- a/tools/cmakev2/project.cmake +++ b/tools/cmakev2/project.cmake @@ -190,7 +190,7 @@ function(__init_project_configuration) # Subprojects that handle their own compiler optimization flags can set the # SET_COMPILER_OPTIMIZATION build property to NO before idf_project_init(). idf_build_get_property(set_compiler_optimization SET_COMPILER_OPTIMIZATION) - if(NOT set_compiler_optimization) + if(NOT DEFINED set_compiler_optimization OR set_compiler_optimization STREQUAL "") set(set_compiler_optimization YES) endif() if(set_compiler_optimization)