c++ - gcc auto dependency full path -
i have simple project - has foo.cxx
, bar.h
:
// bar.h // nothing // foo.cxx #include "bar.h" // nothing else
if include bar.h
""
s, dependency file has full paths:
$ g++ -std=c++11 -mp -mmd -mf /home/barry/sandbox/foo.d -c /home/barry/sandbox/foo.cxx -o /home/barry/sandbox/foo.o $ cat foo.d /home/barry/sandbox/foo.o: /home/barry/sandbox/foo.cxx \ /home/barry/sandbox/bar.h /home/barry/sandbox/bar.h:
however, if include <>
s , add -i.
, bar.h
itself:
$ g++ -std=c++11 -i. -mp -mmd -mf /home/barry/sandbox/foo.d -c /home/barry/sandbox/foo.cxx -o /home/barry/sandbox/foo.o $ cat foo.d /home/barry/sandbox/foo.o: /home/barry/sandbox/foo.cxx bar.h bar.h:
is there way full paths all of files?
the issue -i.
when gcc determining include <bar.h>
, find ./bar.h
, , printed in dependency file in same way.
if provide full path via -i
well:
$ g++ -std=c++11 -i/home/barry/sandbox -mp -mmd -mf /home/barry/sandbox/foo.d -c /home/barry/sandbox/foo.cxx -o /home/barry/sandbox/foo.o
then regardless of ""
or <>
, full path of bar.h
in foo.d
, desired.
Comments
Post a Comment