Viewing preprocessor output?

Answered

Is there a way to see preprocessor output, such as one would get when compiling with -E ?

4
4 comments

Using CLion 2020.2, I'm able to open a TU file and use the "clangd: Preprocess current TU" action to open a tab displaying the contents of the preprocessor output.

Very useful! So much that I now have a shortcut for it.

5

Hi Jacob. I don't understand where you want to see this output? Anyway, you can manually update CMake options in `File | Settings | Build, Execution, Deployment | CMake` with adding -E to compiler flags.

0
Avatar
Permanently deleted user

Hi Maxim,

I'm not too picky about 'where' it shows up, just that I could find it (and I was hoping not to have to add -E manually).

 

Thanks.

0
Avatar
Permanently deleted user

Maybe what Jacob is looking for (and myself) is the equivalent to "preprocessor to a file" option in visual studio which creates an .i file

0

Please sign in to leave a comment.