Reputation: 5642
Brian Kretzler’s book explains how <FileWrites>
is used to remember what was actually written so cleaning can work even if the exact files has changed since the build. But, it doesn't do anything for me.
Inside a Target
, I have
<ItemGroup>
<FileWrites Include="@(QtUICompile->'$(GeneratedDir)/ui_%(Filename).h)" />
</ItemGroup>
in one case, where the @-expression is exactly the same as used for Outputs, and
<ItemGroup>
<FileWrites Include="@(QtResourceOutput)" />
</ItemGroup>
in another case where the item array QtResourceOutput
is created first and used for both the Outputs and here, and is also used in a Message
so I can see that it is getting the file name right, and the feature of noticing that outputs are up-to-date works correctly.
When I do a Clean of the solution (or of a project that caused these targets to be performed before its ClCompile
task), those files are not removed.
What am I doing wrong? Is there a way to troubleshoot this feature?
Upvotes: 2
Views: 1360
Reputation: 5642
I've learned that the FileWrites
item list is not used in C++ projects. To troubleshoot, I used the --preprocess
//preprocess
MSBuild option and looked for uses of FileWrites
in the flattened project file. The cleaning pathway did not use it, and it appeared that ClCompile
did not use it (not in the XML script anyway; it might still do odd things inside the Task I later learned)
Upvotes: 3