by grandmczeb · 7y ago · 0 comments
Are you sure this is required? I just tried with a test repo and Bazel only performed two actions after I updated foo_main.cpp (compile foo_main.cpp and link app.)
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.