I have a CMake project that I compile with gcc on Linux. Because of how CMake invokes gcc in subdirectories, gcc outputs only the base file name when it encounters an error:
[100%] Building C object path/file.c.o
cd /absolute/path && /usr/bin/cc [...]
file.c: In function ‘foo’:
file.c:85:5: error: unknown type name ‘bar’
How can I see the full file path in the gcc output? Any solution through either CMake or gcc configuration would be acceptable. I want to see something like this:
/absolute/path/file.c:85:5: error: unknown type name ‘bar’
or
path/file.c:85:5: error: unknown type name ‘bar’
(preferrably the former).