Loading android/sdk.go +5 −4 Original line number Diff line number Diff line Loading @@ -304,10 +304,11 @@ type SdkMemberType interface { // SdkAware and be added with an SdkMemberTypeDependencyTag tag. HasTransitiveSdkMembers() bool // Add dependencies from the SDK module to all the variants the member // contributes to the SDK. The exact set of variants required is determined // by the SDK and its properties. The dependencies must be added with the // supplied tag. // Add dependencies from the SDK module to all the module variants the member // type contributes to the SDK. `names` is the list of module names given in // the member type property (as returned by SdkPropertyName()) in the SDK // module. The exact set of variants required is determined by the SDK and its // properties. The dependencies must be added with the supplied tag. // // The BottomUpMutatorContext provided is for the SDK module. AddDependencies(mctx BottomUpMutatorContext, dependencyTag blueprint.DependencyTag, names []string) Loading cc/library_headers.go +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ var headersLibrarySdkMemberType = &librarySdkMemberType{ SupportsSdk: true, }, prebuiltModuleType: "cc_prebuilt_library_headers", linkTypes: nil, noOutputFiles: true, } func RegisterLibraryHeadersBuildComponents(ctx android.RegistrationContext) { Loading cc/library_sdk_member.go +6 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ import ( "path/filepath" "android/soong/android" "github.com/google/blueprint" "github.com/google/blueprint/proptools" ) Loading Loading @@ -53,7 +54,10 @@ type librarySdkMemberType struct { prebuiltModuleType string // The set of link types supported, set of "static", "shared". noOutputFiles bool // True if there are no srcs files. // The set of link types supported. A set of "static", "shared", or nil to // skip link type variations. linkTypes []string } Loading Loading @@ -327,7 +331,7 @@ func (p *nativeLibInfoProperties) PopulateFromVariant(variant android.SdkAware) // If the library has some link types then it produces an output binary file, otherwise it // is header only. if p.memberType.linkTypes != nil { if !p.memberType.noOutputFiles { p.outputFile = ccModule.OutputFile().Path() } Loading cc/object.go +19 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,16 @@ import ( func init() { android.RegisterModuleType("cc_object", ObjectFactory) android.RegisterSdkMemberType(ccObjectSdkMemberType) } var ccObjectSdkMemberType = &librarySdkMemberType{ SdkMemberTypeBase: android.SdkMemberTypeBase{ PropertyName: "native_objects", SupportsSdk: true, }, prebuiltModuleType: "cc_prebuilt_object", linkTypes: nil, } type objectLinker struct { Loading @@ -47,12 +57,18 @@ type ObjectLinkerProperties struct { Linker_script *string `android:"path,arch_variant"` } func newObject() *Module { module := newBaseModule(android.HostAndDeviceSupported, android.MultilibBoth) module.sanitize = &sanitize{} module.stl = &stl{} return module } // cc_object runs the compiler without running the linker. It is rarely // necessary, but sometimes used to generate .s files from .c files to use as // input to a cc_genrule module. func ObjectFactory() android.Module { module := newBaseModule(android.HostAndDeviceSupported, android.MultilibBoth) module.sanitize = &sanitize{} module := newObject() module.linker = &objectLinker{ baseLinker: NewBaseLinker(module.sanitize), } Loading @@ -61,7 +77,7 @@ func ObjectFactory() android.Module { // Clang's address-significance tables are incompatible with ld -r. module.compiler.appendCflags([]string{"-fno-addrsig"}) module.stl = &stl{} module.sdkMemberTypes = []android.SdkMemberType{ccObjectSdkMemberType} return module.Init() } Loading cc/prebuilt.go +45 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ func RegisterPrebuiltBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("cc_prebuilt_library", PrebuiltLibraryFactory) ctx.RegisterModuleType("cc_prebuilt_library_shared", PrebuiltSharedLibraryFactory) ctx.RegisterModuleType("cc_prebuilt_library_static", PrebuiltStaticLibraryFactory) ctx.RegisterModuleType("cc_prebuilt_object", prebuiltObjectFactory) ctx.RegisterModuleType("cc_prebuilt_binary", prebuiltBinaryFactory) } Loading Loading @@ -217,6 +218,50 @@ func NewPrebuiltStaticLibrary(hod android.HostOrDeviceSupported) (*Module, *libr return module, library } type prebuiltObjectProperties struct { Srcs []string `android:"path,arch_variant"` } type prebuiltObjectLinker struct { android.Prebuilt objectLinker properties prebuiltObjectProperties } func (p *prebuiltObjectLinker) prebuilt() *android.Prebuilt { return &p.Prebuilt } var _ prebuiltLinkerInterface = (*prebuiltObjectLinker)(nil) func (p *prebuiltObjectLinker) link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path { if len(p.properties.Srcs) > 0 { return p.Prebuilt.SingleSourcePath(ctx) } return nil } func newPrebuiltObject() *Module { module := newObject() prebuilt := &prebuiltObjectLinker{ objectLinker: objectLinker{ baseLinker: NewBaseLinker(nil), }, } module.linker = prebuilt module.AddProperties(&prebuilt.properties) android.InitPrebuiltModule(module, &prebuilt.properties.Srcs) android.InitSdkAwareModule(module) return module } func prebuiltObjectFactory() android.Module { module := newPrebuiltObject() return module.Init() } type prebuiltBinaryLinker struct { *binaryDecorator prebuiltLinker Loading Loading
android/sdk.go +5 −4 Original line number Diff line number Diff line Loading @@ -304,10 +304,11 @@ type SdkMemberType interface { // SdkAware and be added with an SdkMemberTypeDependencyTag tag. HasTransitiveSdkMembers() bool // Add dependencies from the SDK module to all the variants the member // contributes to the SDK. The exact set of variants required is determined // by the SDK and its properties. The dependencies must be added with the // supplied tag. // Add dependencies from the SDK module to all the module variants the member // type contributes to the SDK. `names` is the list of module names given in // the member type property (as returned by SdkPropertyName()) in the SDK // module. The exact set of variants required is determined by the SDK and its // properties. The dependencies must be added with the supplied tag. // // The BottomUpMutatorContext provided is for the SDK module. AddDependencies(mctx BottomUpMutatorContext, dependencyTag blueprint.DependencyTag, names []string) Loading
cc/library_headers.go +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ var headersLibrarySdkMemberType = &librarySdkMemberType{ SupportsSdk: true, }, prebuiltModuleType: "cc_prebuilt_library_headers", linkTypes: nil, noOutputFiles: true, } func RegisterLibraryHeadersBuildComponents(ctx android.RegistrationContext) { Loading
cc/library_sdk_member.go +6 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ import ( "path/filepath" "android/soong/android" "github.com/google/blueprint" "github.com/google/blueprint/proptools" ) Loading Loading @@ -53,7 +54,10 @@ type librarySdkMemberType struct { prebuiltModuleType string // The set of link types supported, set of "static", "shared". noOutputFiles bool // True if there are no srcs files. // The set of link types supported. A set of "static", "shared", or nil to // skip link type variations. linkTypes []string } Loading Loading @@ -327,7 +331,7 @@ func (p *nativeLibInfoProperties) PopulateFromVariant(variant android.SdkAware) // If the library has some link types then it produces an output binary file, otherwise it // is header only. if p.memberType.linkTypes != nil { if !p.memberType.noOutputFiles { p.outputFile = ccModule.OutputFile().Path() } Loading
cc/object.go +19 −3 Original line number Diff line number Diff line Loading @@ -26,6 +26,16 @@ import ( func init() { android.RegisterModuleType("cc_object", ObjectFactory) android.RegisterSdkMemberType(ccObjectSdkMemberType) } var ccObjectSdkMemberType = &librarySdkMemberType{ SdkMemberTypeBase: android.SdkMemberTypeBase{ PropertyName: "native_objects", SupportsSdk: true, }, prebuiltModuleType: "cc_prebuilt_object", linkTypes: nil, } type objectLinker struct { Loading @@ -47,12 +57,18 @@ type ObjectLinkerProperties struct { Linker_script *string `android:"path,arch_variant"` } func newObject() *Module { module := newBaseModule(android.HostAndDeviceSupported, android.MultilibBoth) module.sanitize = &sanitize{} module.stl = &stl{} return module } // cc_object runs the compiler without running the linker. It is rarely // necessary, but sometimes used to generate .s files from .c files to use as // input to a cc_genrule module. func ObjectFactory() android.Module { module := newBaseModule(android.HostAndDeviceSupported, android.MultilibBoth) module.sanitize = &sanitize{} module := newObject() module.linker = &objectLinker{ baseLinker: NewBaseLinker(module.sanitize), } Loading @@ -61,7 +77,7 @@ func ObjectFactory() android.Module { // Clang's address-significance tables are incompatible with ld -r. module.compiler.appendCflags([]string{"-fno-addrsig"}) module.stl = &stl{} module.sdkMemberTypes = []android.SdkMemberType{ccObjectSdkMemberType} return module.Init() } Loading
cc/prebuilt.go +45 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ func RegisterPrebuiltBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("cc_prebuilt_library", PrebuiltLibraryFactory) ctx.RegisterModuleType("cc_prebuilt_library_shared", PrebuiltSharedLibraryFactory) ctx.RegisterModuleType("cc_prebuilt_library_static", PrebuiltStaticLibraryFactory) ctx.RegisterModuleType("cc_prebuilt_object", prebuiltObjectFactory) ctx.RegisterModuleType("cc_prebuilt_binary", prebuiltBinaryFactory) } Loading Loading @@ -217,6 +218,50 @@ func NewPrebuiltStaticLibrary(hod android.HostOrDeviceSupported) (*Module, *libr return module, library } type prebuiltObjectProperties struct { Srcs []string `android:"path,arch_variant"` } type prebuiltObjectLinker struct { android.Prebuilt objectLinker properties prebuiltObjectProperties } func (p *prebuiltObjectLinker) prebuilt() *android.Prebuilt { return &p.Prebuilt } var _ prebuiltLinkerInterface = (*prebuiltObjectLinker)(nil) func (p *prebuiltObjectLinker) link(ctx ModuleContext, flags Flags, deps PathDeps, objs Objects) android.Path { if len(p.properties.Srcs) > 0 { return p.Prebuilt.SingleSourcePath(ctx) } return nil } func newPrebuiltObject() *Module { module := newObject() prebuilt := &prebuiltObjectLinker{ objectLinker: objectLinker{ baseLinker: NewBaseLinker(nil), }, } module.linker = prebuilt module.AddProperties(&prebuilt.properties) android.InitPrebuiltModule(module, &prebuilt.properties.Srcs) android.InitSdkAwareModule(module) return module } func prebuiltObjectFactory() android.Module { module := newPrebuiltObject() return module.Init() } type prebuiltBinaryLinker struct { *binaryDecorator prebuiltLinker Loading