I have a custom parser that generate C++ files and add them into a project. What I would like to do is call this parser before building my project and compile the new generated files in the same build. I use VS2010. I tried to call the parser in the PreBuild, the generated files are correctly added in the project (I can see them in the IDE) but they are not compiled. Like if the project doesn’t know that it have new files in it.
Share
I’m not sure, but do not fully know, if files added to the project during the PreBuild phase are actually included in the compilation. I believe that the files included is calculated before the PreBuild phase is run.
One way to work around this though is to add an empty file into the project and include it in the compilation. Have your prebuild phase overwrite this file and the postbuild phase re-initialize it to nothing. That should fix this issue.