Ver Fonte

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

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

See merge request espressif/esp-idf!7646
Angus Gratton há 6 anos atrás
pai
commit
024a2755be
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      tools/kconfig_new/confgen.py

+ 2 - 0
tools/kconfig_new/confgen.py

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