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 6648127362
commit 9c1d75cc5b

View file

@ -158,6 +158,8 @@ def write_cmake(config, filename):
if sym._write_to_conf:
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))
config.walk_menu(write_node)