I seem to remember researching the difference between strip_include_prefix="" and include_prefix="" with bazel 2.0. I found that under some conditions we could skip the potentially expensive generation of _virtual_includes. I came to the conclusion that by preferring strip_include_prefix=""" and the cc_library would just add an additional include path to effectively strip part of the path away. This is great for importing huge libraries like boost, where you want to not have absolute repo paths, but avoid _virtual_includes.
I have since upgraded to a much newer version of Bazel and went back to look at it, and I can't see evidence of it adding a -I to the include path.
What I thought you could do was:
Have your say boost library somewhere like:
//external/boost/include/boost/{all the headers}
If you put a BUILD file in "//external/boost/include/"
cc_library(
name = "headers",
strip_include_prefix = "",
hdrs = and glob(["boost/**/*.hpp"]),
)
It adds would add a -I to the include path of all cc_* which depend on that library.
Was this the case, or do I miss-remember?
James