I'm not sure if this is the right place for this question, but I'll give it shot
Using Visual Studio Code, I have the task.json set up to launch a batch file that is set up like follow:
@echo off
call "Z:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
set INC_PROJECT_PATH="Z:\Asus\Documenti\VS Code\Projects\Packman Clone 1"
set INC_SDL_PATH="Z:\Dependencies\SDL2-2.0.5\SLD2"
set SOURCE1_PATH="Z:\Asus\Documenti\VS Code\Projects\Packman Clone 1\source\*.cpp"
set SOURCE2_PATH="Z:\Asus\Documenti\VS Code\Projects\Packman Clone 1\Engine\*.cpp"
set LIB_SDL_PATH="Z:\Dependencies\SDL2-2.0.5\lib\x86"
set OUTPUT_PATH="Z:\Asus\Documenti\VS Code\Projects\Packman Clone 1\Debug\Pacman.exe"
cl /std:c++latest /W4 /ZI ^
/I %INC_SDL_PATH% /I %INC_PROJECT_PATH% ^
/EHsc %SOURCE1_PATH% %SOURCE2_PATH% ^
/link /SUBSYSTEM:CONSOLE ^
/LIBPATH:%LIB_SDL_PATH% SDL2main.lib SDL2.lib ^
/out:%OUTPUT_PATH%
I'm not totally sure about what it's doing and I'm piecing it togeter as I go (trial and error + google), so if I got it right, the *.cpp at the end of those paths, it means that every time I build it will build all the .cpp that it finds in those 2 paths.
And that doesn't sounds good, so I was wondering, there is a way to tell it to re-compile only the files that have changed?