Merge branch 'bugfix/kconfig_cmake_escape_v4.1' into 'release/v4.1'

confgen.py: Escape special characters for cmake (v4.1)

See merge request espressif/esp-idf!7645
This commit is contained in:
Angus Gratton 2020-02-19 08:00:53 +08:00
commit 3f4da83520

View file

@ -408,6 +408,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))