Loading android/arch.go +5 −5 Original line number Diff line number Diff line Loading @@ -596,7 +596,7 @@ var BuildOs = func() OsType { }() var ( osTypeList []OsType OsTypeList []OsType commonTargetMap = make(map[string]Target) NoOsType OsType Loading Loading @@ -672,7 +672,7 @@ func NewOsType(name string, class OsClass, defDisabled bool) OsType { DefaultDisabled: defDisabled, } osTypeList = append(osTypeList, os) OsTypeList = append(OsTypeList, os) if _, found := commonTargetMap[name]; found { panic(fmt.Errorf("Found Os type duplicate during OsType registration: %q", name)) Loading @@ -684,7 +684,7 @@ func NewOsType(name string, class OsClass, defDisabled bool) OsType { } func osByName(name string) OsType { for _, os := range osTypeList { for _, os := range OsTypeList { if os.Name == name { return os } Loading Loading @@ -750,7 +750,7 @@ func osMutator(mctx BottomUpMutatorContext) { var moduleOSList []OsType for _, os := range osTypeList { for _, os := range OsTypeList { supportedClass := false for _, osClass := range osClasses { if os.Class == osClass { Loading Loading @@ -1071,7 +1071,7 @@ func createArchPropTypeDesc(props reflect.Type) []archPropTypeDesc { "Arm_on_x86", "Arm_on_x86_64", } for _, os := range osTypeList { for _, os := range OsTypeList { targets = append(targets, os.Field) for _, archType := range osArchTypeMap[os] { Loading android/sdk.go +20 −1 Original line number Diff line number Diff line Loading @@ -448,10 +448,29 @@ func RegisterSdkMemberType(memberType SdkMemberType) { // Base structure for all implementations of SdkMemberProperties. // // Contains common properties that apply across many different member types. // Contains common properties that apply across many different member types. These // are not affected by the optimization to extract common values. type SdkMemberPropertiesBase struct { // The setting to use for the compile_multilib property. Compile_multilib string // The number of unique os types supported by the member variants. Os_count int // The os type for which these properties refer. Os OsType } // The os prefix to use for any file paths in the sdk. // // Is an empty string if the member only provides variants for a single os type, otherwise // is the OsType.Name. func (b *SdkMemberPropertiesBase) OsPrefix() string { if b.Os_count == 1 { return "" } else { return b.Os.Name } } func (b *SdkMemberPropertiesBase) Base() *SdkMemberPropertiesBase { Loading cc/binary_sdk_member.go +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ const ( // path to the native binary. Relative to <sdk_root>/<api_dir> func nativeBinaryPathFor(lib nativeBinaryInfoProperties) string { return filepath.Join(lib.archType, return filepath.Join(lib.OsPrefix(), lib.archType, nativeBinaryDir, lib.outputFile.Base()) } Loading cc/library_sdk_member.go +1 −1 Original line number Diff line number Diff line Loading @@ -254,7 +254,7 @@ const ( // path to the native library. Relative to <sdk_root>/<api_dir> func nativeLibraryPathFor(lib *nativeLibInfoProperties) string { return filepath.Join(lib.archType, return filepath.Join(lib.OsPrefix(), lib.archType, nativeStubDir, lib.outputFile.Base()) } Loading cc/testing.go +20 −3 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) { ctx.RegisterModuleType("ndk_prebuilt_object", NdkPrebuiltObjectFactory) } func GatherRequiredDepsForTest(os android.OsType) string { func GatherRequiredDepsForTest(oses ...android.OsType) string { ret := ` toolchain_library { name: "libatomic", Loading Loading @@ -341,6 +341,7 @@ func GatherRequiredDepsForTest(os android.OsType) string { } ` for _, os := range oses { if os == android.Fuchsia { ret += ` cc_library { Loading @@ -353,6 +354,22 @@ func GatherRequiredDepsForTest(os android.OsType) string { } ` } if os == android.Windows { ret += ` toolchain_library { name: "libwinpthread", host_supported: true, enabled: false, target: { windows: { enabled: true, }, }, src: "", } ` } } return ret } Loading Loading
android/arch.go +5 −5 Original line number Diff line number Diff line Loading @@ -596,7 +596,7 @@ var BuildOs = func() OsType { }() var ( osTypeList []OsType OsTypeList []OsType commonTargetMap = make(map[string]Target) NoOsType OsType Loading Loading @@ -672,7 +672,7 @@ func NewOsType(name string, class OsClass, defDisabled bool) OsType { DefaultDisabled: defDisabled, } osTypeList = append(osTypeList, os) OsTypeList = append(OsTypeList, os) if _, found := commonTargetMap[name]; found { panic(fmt.Errorf("Found Os type duplicate during OsType registration: %q", name)) Loading @@ -684,7 +684,7 @@ func NewOsType(name string, class OsClass, defDisabled bool) OsType { } func osByName(name string) OsType { for _, os := range osTypeList { for _, os := range OsTypeList { if os.Name == name { return os } Loading Loading @@ -750,7 +750,7 @@ func osMutator(mctx BottomUpMutatorContext) { var moduleOSList []OsType for _, os := range osTypeList { for _, os := range OsTypeList { supportedClass := false for _, osClass := range osClasses { if os.Class == osClass { Loading Loading @@ -1071,7 +1071,7 @@ func createArchPropTypeDesc(props reflect.Type) []archPropTypeDesc { "Arm_on_x86", "Arm_on_x86_64", } for _, os := range osTypeList { for _, os := range OsTypeList { targets = append(targets, os.Field) for _, archType := range osArchTypeMap[os] { Loading
android/sdk.go +20 −1 Original line number Diff line number Diff line Loading @@ -448,10 +448,29 @@ func RegisterSdkMemberType(memberType SdkMemberType) { // Base structure for all implementations of SdkMemberProperties. // // Contains common properties that apply across many different member types. // Contains common properties that apply across many different member types. These // are not affected by the optimization to extract common values. type SdkMemberPropertiesBase struct { // The setting to use for the compile_multilib property. Compile_multilib string // The number of unique os types supported by the member variants. Os_count int // The os type for which these properties refer. Os OsType } // The os prefix to use for any file paths in the sdk. // // Is an empty string if the member only provides variants for a single os type, otherwise // is the OsType.Name. func (b *SdkMemberPropertiesBase) OsPrefix() string { if b.Os_count == 1 { return "" } else { return b.Os.Name } } func (b *SdkMemberPropertiesBase) Base() *SdkMemberPropertiesBase { Loading
cc/binary_sdk_member.go +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ const ( // path to the native binary. Relative to <sdk_root>/<api_dir> func nativeBinaryPathFor(lib nativeBinaryInfoProperties) string { return filepath.Join(lib.archType, return filepath.Join(lib.OsPrefix(), lib.archType, nativeBinaryDir, lib.outputFile.Base()) } Loading
cc/library_sdk_member.go +1 −1 Original line number Diff line number Diff line Loading @@ -254,7 +254,7 @@ const ( // path to the native library. Relative to <sdk_root>/<api_dir> func nativeLibraryPathFor(lib *nativeLibInfoProperties) string { return filepath.Join(lib.archType, return filepath.Join(lib.OsPrefix(), lib.archType, nativeStubDir, lib.outputFile.Base()) } Loading
cc/testing.go +20 −3 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) { ctx.RegisterModuleType("ndk_prebuilt_object", NdkPrebuiltObjectFactory) } func GatherRequiredDepsForTest(os android.OsType) string { func GatherRequiredDepsForTest(oses ...android.OsType) string { ret := ` toolchain_library { name: "libatomic", Loading Loading @@ -341,6 +341,7 @@ func GatherRequiredDepsForTest(os android.OsType) string { } ` for _, os := range oses { if os == android.Fuchsia { ret += ` cc_library { Loading @@ -353,6 +354,22 @@ func GatherRequiredDepsForTest(os android.OsType) string { } ` } if os == android.Windows { ret += ` toolchain_library { name: "libwinpthread", host_supported: true, enabled: false, target: { windows: { enabled: true, }, }, src: "", } ` } } return ret } Loading