From 300008f510791310287f0da92d41ca0a56b41a07 Mon Sep 17 00:00:00 2001 From: jzlv Date: Mon, 27 Feb 2023 10:39:28 +0800 Subject: [PATCH] [chore][cmake] fix escape --- cmake/gen_c_cpp_properties_json.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/gen_c_cpp_properties_json.cmake b/cmake/gen_c_cpp_properties_json.cmake index fc997844..807ce833 100644 --- a/cmake/gen_c_cpp_properties_json.cmake +++ b/cmake/gen_c_cpp_properties_json.cmake @@ -10,7 +10,8 @@ foreach(item ${C_CPP_PROPERTIES_INCLUDE}) endforeach() 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() get_filename_component(SYS_INCLUDE_PATH ${CMAKE_C_COMPILER} DIRECTORY)