[chore][cmake] fix escape

This commit is contained in:
jzlv 2023-02-27 10:39:28 +08:00
parent 4799ec132e
commit 300008f510

View File

@ -10,7 +10,8 @@ foreach(item ${C_CPP_PROPERTIES_INCLUDE})
endforeach() endforeach()
foreach(item ${C_CPP_PROPERTIES_DEFINES}) foreach(item ${C_CPP_PROPERTIES_DEFINES})
string(APPEND C_CPP_PROPERTIES_DEFINES_IN "\n \"${item}\",") string(REGEX REPLACE "([^\"])([\"])" "\\1\\\\\"" nitem ${item})
string(APPEND C_CPP_PROPERTIES_DEFINES_IN "\n \"${nitem}\",")
endforeach() endforeach()
get_filename_component(SYS_INCLUDE_PATH ${CMAKE_C_COMPILER} DIRECTORY) get_filename_component(SYS_INCLUDE_PATH ${CMAKE_C_COMPILER} DIRECTORY)