by joshuamorton · 7y ago · 0 comments
Foo.cc that depends on a a lib that's glob of a.h, b.h, c.h, d.h.
Foo.cc that depends on a_lib, b_lib, etc.
Modify a. In the first case, you'll have to recompile all of abcd. In the second, only a.
Note that adding and removing files (including through a glob) does always cause a rebuild though (because it's a change of the rule). This is a deficiency of bazel.
The other nice thing is you get dead code elimination for free.
The other place this is obvious is with tests. If you have a unit test per source, a change to any source will return all tests, splitting reduces this.