How to build individual c++ files

hi,

i want to set up my environment (vscode+PIO) in a way that it rebuild c++ file as i save. I dont want to run link only cpp object file. is there task in vscode or command line that i can invoke to build a file by full path etc
Thanks
Sajjad