View source file after macro substitution
Answered
Is there a way to use CLion or other tools to view a cpp file after the macro substitutions have occurred?
I'm looking at this file https://github.com/MTG/essentia/blob/8330e1b06cb51f769594ba56b8d4229f7d1a4883/src/essentia/algorithmfactory.h#L169 which makes heavy use of macros and I want to be view the source after the marcos have been substituted. As a note, that project uses waf as a build system but I've modified it to use CMake instead.
I've looked into other tools, and unifdef https://dotat.at/prog/unifdef/ seems like it might work, but I'm not sure if it's only for C and C++.
Please sign in to leave a comment.
Hello!
You can inline macros - https://www.jetbrains.com/help/clion/inline.html.
Also you can review formatted macro expansions using the Quick Documentation popup - https://www.jetbrains.com/help/clion/viewing-inline-documentation.html.