Created
May 19, 2020 03:01
-
-
Save asklar/f94fc2d1867cefe0f5d3c70d59c8ccba to your computer and use it in GitHub Desktop.
Preprocess C++ to file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<Target Name="Preprocess"> | |
<Message Condition="'$(Source)'!=''" Text="Preprocessing: $(Source)"/> | |
<Error Condition="'$(Source)'==''" Text="To generate a pre-processed file, please specify a source file with msbuild /p:Source=nameOfTheSource.cpp"/> | |
<CL PreprocessToFile="true" Sources="$(Source)" | |
AdditionalIncludeDirectories="%(ClCompile.AdditionalIncludeDirectories)" | |
PreprocessorDefinitions="%(ClCompile.PreprocessorDefinitions)" | |
AdditionalOptions="%(ClCompile.AdditionalOptions) /d1PP" | |
PreprocessKeepComments="true" | |
PreprocessOutputPath="$(Source.Replace('.cpp', '.pp'))" | |
/> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment