diff options
Diffstat (limited to 'cc/cc.go')
| -rw-r--r-- | cc/cc.go | 49 |
1 files changed, 27 insertions, 22 deletions
@@ -57,14 +57,14 @@ func RegisterCCBuildComponents(ctx android.RegistrationContext) { }) ctx.PostDepsMutators(func(ctx android.RegisterMutatorsContext) { - ctx.TopDown("asan_deps", sanitizerDepsMutator(asan)) - ctx.BottomUp("asan", sanitizerMutator(asan)).Parallel() + ctx.TopDown("asan_deps", sanitizerDepsMutator(Asan)) + ctx.BottomUp("asan", sanitizerMutator(Asan)).Parallel() ctx.TopDown("hwasan_deps", sanitizerDepsMutator(hwasan)) ctx.BottomUp("hwasan", sanitizerMutator(hwasan)).Parallel() - ctx.TopDown("fuzzer_deps", sanitizerDepsMutator(fuzzer)) - ctx.BottomUp("fuzzer", sanitizerMutator(fuzzer)).Parallel() + ctx.TopDown("fuzzer_deps", sanitizerDepsMutator(Fuzzer)) + ctx.BottomUp("fuzzer", sanitizerMutator(Fuzzer)).Parallel() // cfi mutator shouldn't run before sanitizers that return true for // incompatibleWithCfi() @@ -419,7 +419,7 @@ type VendorProperties struct { IsLLNDK bool `blueprint:"mutated"` // IsLLNDKPrivate is set to true for the vendor variant of a cc_library module that has LLNDK - // stubs and also sets llndk.vendor_available: false. + // stubs and also sets llndk.private: true. IsLLNDKPrivate bool `blueprint:"mutated"` } @@ -785,6 +785,14 @@ type Module struct { hideApexVariantFromMake bool } +func (c *Module) SetPreventInstall() { + c.Properties.PreventInstall = true +} + +func (c *Module) SetHideFromMake() { + c.Properties.HideFromMake = true +} + func (c *Module) Toc() android.OptionalPath { if c.linker != nil { if library, ok := c.linker.(libraryInterface); ok { @@ -1026,7 +1034,7 @@ func (c *Module) Init() android.Module { // Returns true for dependency roots (binaries) // TODO(ccross): also handle dlopenable libraries -func (c *Module) isDependencyRoot() bool { +func (c *Module) IsDependencyRoot() bool { if root, ok := c.linker.(interface { isDependencyRoot() bool }); ok { @@ -1079,11 +1087,11 @@ func (c *Module) IsLlndkPublic() bool { func (c *Module) isImplementationForLLNDKPublic() bool { library, _ := c.library.(*libraryDecorator) return library != nil && library.hasLLNDKStubs() && - (Bool(library.Properties.Llndk.Vendor_available) || + (!Bool(library.Properties.Llndk.Private) || // TODO(b/170784825): until the LLNDK properties are moved into the cc_library, // the non-Vendor variants of the cc_library don't know if the corresponding - // llndk_library set vendor_available: false. Since libft2 is the only - // private LLNDK library, hardcode it during the transition. + // llndk_library set private: true. Since libft2 is the only private LLNDK + // library, hardcode it during the transition. c.BaseModuleName() != "libft2") } @@ -1091,20 +1099,12 @@ func (c *Module) isImplementationForLLNDKPublic() bool { func (c *Module) IsVndkPrivate() bool { // Check if VNDK-core-private or VNDK-SP-private if c.IsVndk() { - if Bool(c.vndkdep.Properties.Vndk.Private) { - return true - } - // TODO(b/175768895) remove this when we clean up "vendor_available: false" use cases. - if c.VendorProperties.Vendor_available != nil && !Bool(c.VendorProperties.Vendor_available) { - return true - } - return false + return Bool(c.vndkdep.Properties.Vndk.Private) } // Check if LLNDK-private if library, ok := c.library.(*libraryDecorator); ok && c.IsLlndk() { - // TODO(b/175768895) replace this with 'private' property. - return !Bool(library.Properties.Llndk.Vendor_available) + return Bool(library.Properties.Llndk.Private) } return false @@ -1272,7 +1272,7 @@ func (ctx *moduleContextImpl) staticBinary() bool { } func (ctx *moduleContextImpl) header() bool { - return ctx.mod.header() + return ctx.mod.Header() } func (ctx *moduleContextImpl) binary() bool { @@ -1429,6 +1429,10 @@ func (c *Module) Prebuilt() *android.Prebuilt { return nil } +func (c *Module) IsPrebuilt() bool { + return c.Prebuilt() != nil +} + func (c *Module) Name() string { name := c.ModuleBase.Name() if p, ok := c.linker.(interface { @@ -2855,7 +2859,7 @@ func (c *Module) makeLibName(ctx android.ModuleContext, ccDep LinkableInterface, return baseName + ".vendor" } - if c.inVendor() && vendorSuffixModules[baseName] { + if c.InVendor() && vendorSuffixModules[baseName] { return baseName + ".vendor" } else if c.InRecovery() && recoverySuffixModules[baseName] { return baseName + ".recovery" @@ -2967,7 +2971,8 @@ func (c *Module) staticBinary() bool { return false } -func (c *Module) header() bool { +// Header returns true if the module is a header-only variant. (See cc/library.go header()). +func (c *Module) Header() bool { if h, ok := c.linker.(interface { header() bool }); ok { |