confgen.py: Escape special characters for cmake

Closes https://github.com/espressif/esp-idf/issues/4751
This commit is contained in:
Roland Dobai 2020-02-12 14:25:15 +01:00
parent 477e6355eb
commit 6b6d9d7321

View file

@ -371,6 +371,8 @@ def write_cmake(deprecated_options, config, filename):
val = sym.str_value
if sym.orig_type in (kconfiglib.BOOL, kconfiglib.TRISTATE) and val == "n":
val = "" # write unset values as empty variables
elif sym.orig_type == kconfiglib.STRING:
val = kconfiglib.escape(val)
write("set({}{} \"{}\")\n".format(
prefix, sym.name, val))