I’m running Visual Studio Community 2015 w/ VisualGDB, working on an STM32 project. I would like to instruct the tool to build one particular file with each build. Is there a way to force recompilation on a file by file basis? If so, where do I implement that command and what is the format for that command?
There isn’t any specific setting that would do that directly, but you could try adding a pre-build step that would regenerate some header file, and including that file from all sources that you would like to be rebuilt.
Thanks for the tip. Where exactly are pre-build steps like that added in VisualGDB? (and what’s the format of the command to regenerate such a header file?)
You can configure custom pre-build steps via VisualGDB Project Properties -> Custom Build Steps.
As for the command line, it’s something for you to figure out. VisualGDB can run arbitrary command lines at different times during the build as configured via VisualGDB Project Properties, but it’s up to the user to make sure these command lines make sense and work as expected.
Note to the community: I am able to achieve my objective by putting my system commands into a batch file (e.g. my_bat.bat) placed in the $(BuildDir) and then calling it as a pre build command using the command:
Thanks for sharing this. This happens because “del” is not a separate executable, but is rather a built-in command of cmd.exe. If you don’t want to use a temporary batch file, you can also do this: