mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 09:45:55 +08:00
cmake:correct the dequote execution of generating config.h
handling quotation marks consistent with `cfgdefine.c` Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
@@ -87,7 +87,6 @@ foreach(NameAndValue ${ConfigContents})
|
||||
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
||||
string(REGEX MATCH "^CONFIG[^=]+" NAME ${NameAndValue})
|
||||
string(REPLACE "${NAME}=" "" VALUE ${NameAndValue})
|
||||
|
||||
if(NAME AND NOT "${VALUE}" STREQUAL "")
|
||||
if(${VALUE} STREQUAL "y")
|
||||
file(APPEND ${CONFIG_H} "#define ${NAME} 1\n")
|
||||
@@ -99,7 +98,8 @@ foreach(NameAndValue ${ConfigContents})
|
||||
foreach(dequote ${DEQUOTELIST})
|
||||
if("${NAME}" STREQUAL "${dequote}")
|
||||
if(NOT "${VALUE}" STREQUAL "\"\"")
|
||||
string(REGEX REPLACE "\"" "" VALUE ${VALUE})
|
||||
string(REGEX REPLACE "^\"(.*)\"$" "\\1" VALUE "${VALUE}")
|
||||
string(REGEX REPLACE "\\\\\\\"" "\"" VALUE "${VALUE}")
|
||||
else()
|
||||
set(VALUE)
|
||||
file(APPEND ${CONFIG_H} "#undef ${NAME}\n")
|
||||
|
||||
Reference in New Issue
Block a user