Hello,
I am working on VS2010 on Windows 7.
I have a custom VCToolTask for an addon platform and I've discovered that the list of Sources is receives is filtered of all header files (not surprising) and *PCH.cpp files. This is unexpected.
My custom task has to handle building the precompiled header in a special way. The PrecompiledHeaderFile project property is set to the path to the PCH file as it is included (relative to the main include directory). The issue is that I need the relative path to the PCH header file from the VS Project to compile the PCH header.
I was hoping to use the TaskItem.ItemSpec of the correpsonding PCH cpp file to find the project relative path to the PCH header file. Based on the assumption that the PCH header and cpp file will be in the same place (a reasonable assumption in my code base).
The issue I have is that when the PCH cpp file is of the form *PCH.cpp it does not appear in the list of sources in the VCToolTask. The project is configured to use the standard ClCompile task and it is passed to the custom VCToolTask in the .targets file of my platform.
Is there a way to stop the PCH cpp file from being removed from the list of sources to be compiled?
Another work around I've been exploring is to check the items of the VS Project to find the PCH cpp that way. I have not been able to find how to access the VS Project from the VCToolTask. Tips on doing this would also be appreciated.