soong: add os name to cc_genrule
While converting from gn to bp we stumbled upon genrules that have different cmd's for different targets. cc_genrule supports different architectures, but it does not give us any information about the OS types (some genrules are use for both host and android targets). Change-Id: Ida531ad8b59d87a91d6faedbfe8fee9f75640bd1 Test: TH
This commit is contained in:
@@ -48,6 +48,8 @@ type GenruleExtraProperties struct {
|
|||||||
//
|
//
|
||||||
// CC_NATIVE_BRIDGE the name of the subdirectory that native bridge libraries are stored in if
|
// CC_NATIVE_BRIDGE the name of the subdirectory that native bridge libraries are stored in if
|
||||||
// the architecture has native bridge enabled, empty if it is disabled.
|
// the architecture has native bridge enabled, empty if it is disabled.
|
||||||
|
//
|
||||||
|
// CC_OS the name of the OS the command is being executed for.
|
||||||
func GenRuleFactory() android.Module {
|
func GenRuleFactory() android.Module {
|
||||||
module := genrule.NewGenRule()
|
module := genrule.NewGenRule()
|
||||||
|
|
||||||
@@ -68,8 +70,9 @@ func GenRuleFactory() android.Module {
|
|||||||
func genruleCmdModifier(ctx android.ModuleContext, cmd string) string {
|
func genruleCmdModifier(ctx android.ModuleContext, cmd string) string {
|
||||||
target := ctx.Target()
|
target := ctx.Target()
|
||||||
arch := target.Arch.ArchType
|
arch := target.Arch.ArchType
|
||||||
return fmt.Sprintf("CC_ARCH=%s CC_NATIVE_BRIDGE=%s CC_MULTILIB=%s && %s",
|
osName := target.Os.Name
|
||||||
arch.Name, target.NativeBridgeRelativePath, arch.Multilib, cmd)
|
return fmt.Sprintf("CC_ARCH=%s CC_NATIVE_BRIDGE=%s CC_MULTILIB=%s CC_OS=%s && %s",
|
||||||
|
arch.Name, target.NativeBridgeRelativePath, arch.Multilib, osName, cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ android.ImageInterface = (*GenruleExtraProperties)(nil)
|
var _ android.ImageInterface = (*GenruleExtraProperties)(nil)
|
||||||
|
Reference in New Issue
Block a user