Skip to content

Commit 190ed78

Browse files
committed
tools/cmake/common: quote DESCRIPTION in define_overridable_option
The set(..CACHE TYPE DOCSTRING [FORCE]) form treats the docstring as a single argument, but `${DESCRIPTION}` was being expanded unquoted, so multi-word descriptions were spilling their trailing words into subsequent set() arguments. This is latent for the common case because most existing STRING options are driven by the else-branch (not overridden via -D), but any STRING option overridden on the cmake command line with a multi-word description hits it — for example: cmake -DEXECUTORCH_VULKAN_FP16_PRECISION=mediump ... fails with the description text being fed to the downstream shader generator as CLI args. One-char fix: quote "${DESCRIPTION}" in both set() calls. Correct for both single- and multi-word descriptions.
1 parent 39426f6 commit 190ed78

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/cmake/common/preset.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ macro(define_overridable_option NAME DESCRIPTION VALUE_TYPE DEFAULT_VALUE)
8282
if(DEFINED ${NAME} AND NOT DEFINED CACHE{${NAME}})
8383
set(${NAME}
8484
${${NAME}}
85-
CACHE ${VALUE_TYPE} ${DESCRIPTION} FORCE
85+
CACHE ${VALUE_TYPE} "${DESCRIPTION}" FORCE
8686
)
8787
else()
8888
set(${NAME}
8989
${DEFAULT_VALUE}
90-
CACHE ${VALUE_TYPE} ${DESCRIPTION}
90+
CACHE ${VALUE_TYPE} "${DESCRIPTION}"
9191
)
9292
endif()
9393

0 commit comments

Comments
 (0)