Generating Expanded Code Without Macros in IDF Project Using idf.py

pablogventura
Posts: 1
Joined: Tue May 02, 2023 2:30 pm

Generating Expanded Code Without Macros in IDF Project Using idf.py

Postby pablogventura » Tue May 02, 2023 2:38 pm

I have an IDF project where I need to generate the expanded code without macros, so that I can automatically process it with Python. Is there any way to generate the expanded code without macros using idf.py? I appreciate any suggestions or help on this matter. Thank you!

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Generating Expanded Code Without Macros in IDF Project Using idf.py

Postby MicroController » Thu May 04, 2023 8:33 pm

You can add the "save-temps" compiler option, e.g. "-save-temps=obj", to your cmake file, which upon building will make gcc leave you, among binaries and other files, with a "*.ii" file per compilation unit.

You can also invoke the gcc preprocessor only, via gcc -E.

Who is online

Users browsing this forum: No registered users and 122 guests