Add new properties to aid in removing the 1-variant fallback
These new properties are essentially methods to specify "outgoing
transitions" in blueprint files. There are lots of host tests
that want to include apps built for device in their data, so they
need a property that adds dependencies based on the device variants
instead of copying the same host variants.
After this cl is submitted, I'll do an LSC to update all the usages
that are relying on the 1-variant fallback to use these properties
instead.
Bug: 372091092
Test: m nothing --no-skip-soong-tests
Change-Id: I45b8fb024da120ad61606e3a21de86e4392be2a4
diff --git a/cc/compiler.go b/cc/compiler.go
index 7bba962..88d97aa 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -100,6 +100,11 @@
// of genrule modules.
Generated_headers proptools.Configurable[[]string] `android:"arch_variant,variant_prepend"`
+ // Same as generated_headers, but the dependencies will be added based on the first supported
+ // arch variant and the device os variant. This can be useful for creating a host tool that
+ // embeds a copy of a device tool, that it then extracts and pushes to a device at runtime.
+ Device_first_generated_headers proptools.Configurable[[]string] `android:"arch_variant,variant_prepend"`
+
// pass -frtti instead of -fno-rtti
Rtti *bool `android:"arch_variant"`
@@ -294,6 +299,7 @@
deps.GeneratedSources = append(deps.GeneratedSources, compiler.Properties.Generated_sources...)
deps.GeneratedSources = removeListFromList(deps.GeneratedSources, compiler.Properties.Exclude_generated_sources)
deps.GeneratedHeaders = append(deps.GeneratedHeaders, compiler.Properties.Generated_headers.GetOrDefault(ctx, nil)...)
+ deps.DeviceFirstGeneratedHeaders = append(deps.DeviceFirstGeneratedHeaders, compiler.Properties.Device_first_generated_headers.GetOrDefault(ctx, nil)...)
deps.AidlLibs = append(deps.AidlLibs, compiler.Properties.Aidl.Libs...)
android.ProtoDeps(ctx, &compiler.Proto)