Skip to content

Commit

Permalink
tools/kconfiglib: Allow for - in symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKevinWeiss committed Apr 8, 2021
1 parent 13db748 commit 450b70e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dist/tools/kconfiglib/genconfig.py
Expand Up @@ -33,6 +33,7 @@
import os
import sys

from riot_kconfig import RiotKconfig
import kconfiglib


Expand Down Expand Up @@ -386,7 +387,7 @@ def main():
logging.basicConfig(format='[genconfig.py]:%(levelname)s-%(message)s',
level=log_level)

kconf = kconfiglib.Kconfig(args.kconfig_filename, warn_to_stderr=False)
kconf = RiotKconfig(args.kconfig_filename, warn_to_stderr=False)
merge_configs(kconf, args.config_sources)

# HACK: Force all symbols to be evaluated, to catch warnings generated
Expand Down
10 changes: 10 additions & 0 deletions dist/tools/kconfiglib/riot_kconfig.py
Expand Up @@ -18,6 +18,16 @@ def _parse_help(self, node):
for marker in doxygen_markers:
node.help = node.help.replace(marker, "")

def write_autoconf(self, filename=None, header=None):
""" Override to convert - to _ when writing autoconf.h """
tmp_unique_defined_syms = self.unique_defined_syms.copy()
for sym in self.unique_defined_syms:
if not sym._write_to_conf:
continue
sym.name = sym.name.replace('-', '_')
super(RiotKconfig, self).write_autoconf(filename, header)
self.unique_defined_syms = tmp_unique_defined_syms


def standard_riot_kconfig(description=None):
"""
Expand Down

0 comments on commit 450b70e

Please sign in to comment.