Is there a way to prevent Boost.Build from recursively scanning header files for #include directives?

Is there a way to limit the header files that Boost.Build recursively scans for #include directives in a particular directory or set of directories? That is, I would like it to recursively view header files only in my project. I know that external dependencies will not change (and, being Boost and Qt, they are quite large). As a result, I get about 50,000 goals in the dependency tree, which take time to process (which leads to a 1-2-minute build time, even if the files have not actually changed).

The only solution I have found so far is to use the INCLUDE environment variable (I use MSVC) - this means that Boost.Build does not need to be informed about include paths (I use this function) and therefore does not scan them. It seems a bit hacked.

I feel that I am missing something obvious, because I could not find other people experiencing similar problems, although I came across this almost immediately. The closest I came here .

Judging by the debugging output (bjam -d 3), it also looks at most header files more than once ... I don’t know if this means that they are added as dependencies more than once, but, of course, the cost of downloading the file and scanning it all content should be indicated?

If I could say that he should not check a specific directory or set of directories in which I can guarantee that the header files will not change, that would be ideal.

+4
source share
2 answers

This question was also posted on the Boost mailing list, and we got the answer here: http://lists.boost.org/boost-build/2009/04/21734.php .

So, it seems that the answer is that at least out of the box, Boost.Build does not have this feature, and the solution is to configure Boost.Build for your needs, which makes a certain amount of feeling.

However, I am still wondering why this is not a more common problem for people. I see that dependency caching will reduce time, but of course, if we scan all external libraries, we get a huge dependency tree, most of which will be redundant? When I work on a project, I’m not going to often change third-party libraries at all, it seems embarrassing to pay for checking dependencies on them.

+2
source

You might want to check out alternative build tools like SCons . SCons has a -implicit-cache mode where it caches implicit dependencies. This should help in the scenario you described.

Here is an excerpt from the man page .

- implicit cache
Cached Implicit Dependencies. This forces scons to use implicit (scanned) dependencies from the last run, instead of scanning files for implicit dependencies. This can significantly speed up the work of SCons, but with the following restrictions: scons will not detect changes in the search path for implicit dependencies (for example, CPPPATH, LIBPATH), which usually lead to the use of different versions of files with the same name. scons will skip changes in implicit dependencies in cases where a new implicit dependency is added earlier in the search path for an implicit dependency (for example, CPPPATH, LIBPATH) than the current implicit dependency with the same name.

- implicit-deps-changed
Causes SCons to ignore cached implicit dependencies. This causes implicit dependencies to be re-scanned and re-copied. This implies --imble-cache.

- implicit-deps-immutable
Force SCons ignore changes in implicit dependencies. This leads to the continued use of cached implicit dependencies. This implies --imble-cache.

+1
source

All Articles