Maybe this is already possible, but I’m not sure what to search for.
When I Cmd-B to build, I get output in the console like
g++ -Wall -o alpha -Iinclude src/main.cc src/foo.cc
src/foo.cc:8: warning: 'int do_something_dumb()' defined but not used
[Finished]
In any window which has “src/foo.cc” open, at line 8, I expect some kind of squiggly or something.