Viewing preprocessor output?

已回答

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

4

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

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

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

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.

4

请先登录再写评论。