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.
This commit is contained in:
Sudeep Mohanty
2026-06-29 22:10:21 +08:00
committed by BOT
parent e7dca1a3f8
commit d2446422d4
+1 -1
View File
@@ -190,7 +190,7 @@ function(__init_project_configuration)
# Subprojects that handle their own compiler optimization flags can set the # Subprojects that handle their own compiler optimization flags can set the
# SET_COMPILER_OPTIMIZATION build property to NO before idf_project_init(). # SET_COMPILER_OPTIMIZATION build property to NO before idf_project_init().
idf_build_get_property(set_compiler_optimization SET_COMPILER_OPTIMIZATION) 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) set(set_compiler_optimization YES)
endif() endif()
if(set_compiler_optimization) if(set_compiler_optimization)