Просмотр исходного кода

confgen.py: Escape special characters for cmake

Closes https://github.com/espressif/esp-idf/issues/4751
Roland Dobai 6 лет назад
Родитель
Сommit
9c1d75cc5b
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      tools/kconfig_new/confgen.py

+ 2 - 0
tools/kconfig_new/confgen.py

@@ -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)