I learnt how to edit my .vcxproj file to compile some files with /Za and some without.
However it appears that since I'm adding elements to the .vcxproj file, the filters I have set up in the IDE are getting messed up, while the .vcxproj.filters file is turning into a much bigger mess of triple, quadruple, unworking duplicates that writes further duplicates every time it saves.
How can I set a compiler option (like /Za) to automatically apply to all new files, but not some old files, and still have filters working properly?
Here is a condensed example of what I added to my .vcxproj file:
<ItemGroup>
<CLCompile Include="**\*.cpp;" Exclude="BufferTrio.cpp;GraphicsFacade.cpp;">
<AdditionalOptions>/Za %(AdditionalOptions)</AdditionalOptions>
</CLCompile>
<CLCompile Include="BufferTrio.cpp;GraphicsFacade.cpp;">
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
</CLCompile>
</ItemGroup>
<ItemGroup>
<None Include="fragmentShader.glsl" />
<None Include="vertexShader.glsl" />
</ItemGroup>
<ItemGroup>
<Text Include="Notes.txt" />
<Text Include="Todo.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="BufferTrio.h" />
<ClInclude Include="Exceptions.h" />
<ClInclude Include="FileUtils.h" />
<ClInclude Include="GraphicsFacade.h" />
</ItemGroup>
This, oddly, puts all .h files in the right filters, but all cpp/c files at the project's root, outside all filters.
Nothing I do in the IDE or with the .vcxproj.filters file makes a difference that isn't just overwritten next time the project saves.