There is no really elegant way to do this using the External Tools menu, but here is a solution that will work:
Create a new configuration for your project. Call it something like "Debug-Preproc." In this configuration, set the / P switch for the compiler. (Preprocess, no compilation.)
Go to the setup menu of external tools. Create a new item called “Pre-Processing Project”. Set the following options:
- Command:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe - Arguments:
$(ProjectDir)$(ProjectFileName) /Build "Debug-Preproc|Win32"
Now you can use the "Preprocess Project" option in your menu to start the preprocessor in all the source files in the currently selected project. It will generate [filename].i for each of them, which you can open in a text editor.
If you want, you can create an additional step to open the file in a text editor by adding a new external tool to your editor to open $(ItemFileName).i .
It’s not as simple or simple as the ability to right-click a file and select “preprocess”, but I think it’s best if you don’t write the extension.
Dan story
source share