Go Down

Topic: How to get C++ file from Arduino Preprocessor? (Read 3765 times) previous topic - next topic



I need the C++ output from the Arduino preprocessor https://github.com/arduino/arduino-preprocessor

I know it's possible to get the C++ file by enabling verbose output during compile and then clicking verify and finding the temp file, but I wanted to know if there's a way to get the output of the preprocessor.

The GitHub page doesn't have any instructions on how to install the preprocessor or use it seperately.

I am asking here because according to another thread, the Arduino Preprocessor is a part of Arduino CLI.



Jun 15, 2020, 07:45 am Last Edit: Jun 15, 2020, 07:47 am by pert
I know it's not answering your question, but arduino-cli compile --preprocess outputs the preprocessed sketch.

If you do a compilation in the beta build of the Arduino IDE with verbose output enabled, you can see the commands it generates to use the arduino-preprocessor executable (which is bundled with the Arduino IDE under tools-builder/arduino-preprocessor, but only appears to be used by the beta IDE).

My understanding was that arduino-preprocessor is only used by the beta build of the Arduino IDE and Arduino CLI (along with the production and nightly releases of the Arduino IDE) are using the previous preprocessing code originally written for the arduino-builder tool, which has since been moved to Arduino CLI (arduino-builder is still used by the Arduino IDE, but it's become mostly just a wrapper for Arduino CLI). However, I really don't have much of an understanding of the internals of Arduino CLI, so I could be very wrong about this.

Go Up