Handle product_variable asflag for cc_object.

cc_object crtbrand sets product_variable.platform_sdk_version.asflag
and will not compile correctly within mixed builds without it.

Only handles product_variables that expand product variables.

Bug: 181794963
Test: ~/aosp/build/bazel/scripts/milestone-2/demo.sh full
Change-Id: I293fcb18032aa51f63bb7b3de94abd6d1ec38180
This commit is contained in:
Liz Kammer
2021-03-24 10:14:47 -04:00
parent dca349a782
commit a060c4521e
5 changed files with 134 additions and 1 deletions

View File

@@ -539,7 +539,7 @@ func (t *topDownMutatorContext) CreateBazelTargetModule(
Name: &name,
}
b := t.CreateModule(factory, &nameProp, attrs).(BazelTargetModule)
b := t.createModuleWithoutInheritance(factory, &nameProp, attrs).(BazelTargetModule)
b.SetBazelTargetModuleProperties(bazelProps)
return b
}
@@ -608,6 +608,11 @@ func (t *topDownMutatorContext) CreateModule(factory ModuleFactory, props ...int
return module
}
func (t *topDownMutatorContext) createModuleWithoutInheritance(factory ModuleFactory, props ...interface{}) Module {
module := t.bp.CreateModule(ModuleFactoryAdaptor(factory), props...).(Module)
return module
}
func (b *bottomUpMutatorContext) MutatorName() string {
return b.bp.MutatorName()
}