Skip to content

Commit c1e7802

Browse files
committed
cmake/nuttx_kconfig: Don't perform replace on empty string
In Kconfig, it is valid for configuration variables to have no value. However, the replace logic in this cmake file will throw an error that at least four arguments are required if 'Value' is empty. This commit avoids performing the replacement logic if 'Value' is empty to prevent an error on valid, empty configuration variables. Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
1 parent e10bfca commit c1e7802

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmake/nuttx_kconfig.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ function(nuttx_export_kconfig kconfigfile)
8080
string(REPLACE "${Name}=" "" Value ${NameAndValue})
8181

8282
# remove extra quotes
83-
string(REPLACE "\"" "" Value ${Value})
83+
if (Value)
84+
string(REPLACE "\"" "" Value ${Value})
85+
endif()
8486
decode_semicolon(Value)
8587
# Set the variable
8688
set(${Name}

0 commit comments

Comments
 (0)