Commit 4aa0e7af authored by Marc Herbert's avatar Marc Herbert Committed by Anas Nashif
Browse files

west: sign.py: add "REM" support to pass comments through cpp

Generated outputs can be difficult to read, preserving comments helps a
lot and they often provide good `git grep` search keywords.

Signed-off-by: default avatarMarc Herbert <marc.herbert@intel.com>
parent a27e8f9a
Loading
Loading
Loading
Loading
+10 −0
Changes for scripts/west_commands/sign.py: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -444,6 +444,16 @@ class RimageSigner(Signer):
        # unfortunately don't seem to make any difference here and they're
        # gcc-specific)
        preproc_cmd += ['-P']

        # "REM" escapes _leading_ '#' characters from cpp and allows
        # such comments to be preserved in generated/*.toml files:
        #
        #      REM # my comment...
        #
        # Note _trailing_ '#' characters and comments are ignored by cpp
        # and don't need any REM trick.
        preproc_cmd += ['-DREM=']

        preproc_cmd += ['-I', str(self.sof_src_dir / 'src')]
        preproc_cmd += ['-imacros',
                        str(pathlib.Path('zephyr') / 'include' / 'generated' / 'autoconf.h')]