Fix target_compatible_with non-determinism for proto.include_dirs
A single proto providing directory can be used by multiple soong modules. Some of these
can be
1. Host specific
2. Device specific
3. Both host and device
Since the generated proto_library can have 1:many mapping, it should
have an empty target_compatible_with. Compatiblity will be enforced at
the top-level {cc|java|python}_proto_library.
(This is a followup to aosp/2727054 which did not handle this correctly)
Test: Added a unit test
Change-Id: I09b3def70e3d043fd8ba0d1eb4ffff1910f097d1
diff --git a/android/module.go b/android/module.go
index 19502ba..f9ea897 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1371,7 +1371,7 @@
for _, axis := range enabledPropertyOverrides.SortedConfigurationAxes() {
configToBools := enabledPropertyOverrides.ConfigurableValues[axis]
for cfg, val := range configToBools {
- if axis != bazel.OsConfigurationAxis || osSupport[cfg] {
+ if axis != bazel.OsConfigurationAxis || osSupport[cfg] || val /*If enabled is explicitly requested via overrides */ {
enabledProperty.SetSelectValue(axis, cfg, &val)
}
}