Skip to content

Commit

Permalink
west: sign.py: add "REM" support to pass comments through cpp
Browse files Browse the repository at this point in the history
Generated outputs can be difficult to read, preserving comments helps a
lot and they often provide good `git grep` search keywords.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information
marc-hb committed Dec 26, 2023
1 parent 1194f17 commit ad5974d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/west_commands/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ def preprocess_toml(self, config_dir, toml_basename, subdir):
# unfortunately don't seem to make any difference here and they're
# gcc-specific)
preproc_cmd += ['-P']
# REM allows standalone comments to be preserved in generated/*.toml.
# A "double" `REM # my comment...` is not necessary but recommended for
# syntax highlighting.
# Note trailing comments are ignored by cpp and don't need any REM
# trick, a trailing `#` is enough.
preproc_cmd += ['-DREM=#']
preproc_cmd += ['-I', str(self.sof_src_dir / 'src')]
preproc_cmd += ['-imacros',
str(pathlib.Path('zephyr') / 'include' / 'generated' / 'autoconf.h')]
Expand Down

0 comments on commit ad5974d

Please sign in to comment.