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:
parent
92987708ec
commit
7c1de0a347
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user