So I've look at a few questions here which popped up after a search, but I still haven't managed to get this to work.
My project has two files, main.cpp
and shader.comp
.
The shader needs to be compiled before the main program is ran and I have a small .bat
script that does just that. It's set to run as a pre-build event.
However, if I edit shader.comp
and leave main.cpp
unmodified since I last ran the project, there is no need to rebuild the project (according to VS anyway), so there is no need to run any pre-build events and my shader doesn't get compiled.
Is there a way to tell VS2017 (or VS2019) that if some file is modified, then run something, or at least a way to add an arbitrary file to list of files that VS checks against when deciding whether to run the build or not?
I've tried setting "Exclude from build" to "No" in the file properties, but no matter what "Item type" I choose, editing just the shader won't trigger the rebuild.