Allen
Allen

Reputation: 21

Excluding folders from dependencies autogenerated by eclipse?

I'm new to eclipse and haven't been able to solve this problem after 40 minutes of searching.

I have a c++ project in the latest version of eclipse. My project uses boost.

Eclipse generates a makefile for me with a bunch of .d files that list the dependencies. A long list of boost headers are included in the .d files.

When I run make, it scans every single one of the boost headers to see if they have changed. This makes the build speed unbearably slow.

How can I prevent anything in the boost folder from being added to the .d files?

Thanks much.

Upvotes: 1

Views: 97

Answers (1)

Allen
Allen

Reputation: 21

I solved this problem by going to Project -> Properties -> C/C++ Build -> Settings -> Cross G++ Compiler -> Miscellaneous, and at the end of "Other flags", I added "-isystem C:/path/to/boost". This instructed the g++ compiler to treat the included path added by -IC:/path/to/boost as a system header so that the -MD dependency generation flag (used by eclipse) would ignore that directory. See

https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-isystem-1165

https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#index-MMD-1148

Upvotes: 1

Related Questions