wizurd wizurd - 9 months ago 31
C++ Question

How to eliminate certain (non system) headers from dependency files(.d)?

We link in a library(TAO) which is composed of many header files.

Every time I run the pre-processor command on a cpp file( g++ -MM $< $@ ), these library files are automatically included in every .d file generated.

These are obviously not system files and almost never change as far as we're concerned, so I would like to eliminate them from my .d files.

Short of filtering out these header files using sed, is there any built in way to accomplish this?


You may instruct gcc to consider some path as system headers with -isystem; and g++ -MM ignore system-headers.