I have a C++ Bazel project where each target should receive different compiler flags (via copts) depending on their parent target. For example, consider the dependency graph:
I would like the different copts defined in target 1 and target 2 to propagate down to each of the dependency targets independently. In other words, I want each dependency target to receive the copts defined in their parent target(s). This means that there will be two different compiled binaries produced by compiling each of the dependency targets, depending on which parent target is depending on it.
Is this possible with Bazel? If not, are there alternative ways of achieving the same result?
