blob: c6b0bf0ffacdf4b0d73b268769aba9a211d9906b [file] [log] [blame]
Paul Duffin2f6bc092019-12-13 10:40:56 +00001// Copyright 2019 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package cc
16
17import (
18 "path/filepath"
Paul Duffin2f6bc092019-12-13 10:40:56 +000019
20 "android/soong/android"
Martin Stjernholmcd07bce2020-03-10 22:37:59 +000021
Paul Duffin2f6bc092019-12-13 10:40:56 +000022 "github.com/google/blueprint"
Paul Duffin13f02712020-03-06 12:30:43 +000023 "github.com/google/blueprint/proptools"
Paul Duffin2f6bc092019-12-13 10:40:56 +000024)
25
26// This file contains support for using cc library modules within an sdk.
27
Paul Duffina0843f62019-12-13 19:50:38 +000028var sharedLibrarySdkMemberType = &librarySdkMemberType{
29 SdkMemberTypeBase: android.SdkMemberTypeBase{
Martin Stjernholmcaa47d72020-07-11 04:52:24 +010030 PropertyName: "native_shared_libs",
31 SupportsSdk: true,
32 HostOsDependent: true,
Paul Duffina0843f62019-12-13 19:50:38 +000033 },
34 prebuiltModuleType: "cc_prebuilt_library_shared",
35 linkTypes: []string{"shared"},
36}
37
38var staticLibrarySdkMemberType = &librarySdkMemberType{
39 SdkMemberTypeBase: android.SdkMemberTypeBase{
Martin Stjernholmcaa47d72020-07-11 04:52:24 +010040 PropertyName: "native_static_libs",
41 SupportsSdk: true,
42 HostOsDependent: true,
Paul Duffina0843f62019-12-13 19:50:38 +000043 },
44 prebuiltModuleType: "cc_prebuilt_library_static",
45 linkTypes: []string{"static"},
46}
47
Paul Duffin9b76c0b2020-03-12 10:24:35 +000048var staticAndSharedLibrarySdkMemberType = &librarySdkMemberType{
49 SdkMemberTypeBase: android.SdkMemberTypeBase{
Martin Stjernholmcaa47d72020-07-11 04:52:24 +010050 PropertyName: "native_libs",
51 SupportsSdk: true,
52 HostOsDependent: true,
Paul Duffin9b76c0b2020-03-12 10:24:35 +000053 },
54 prebuiltModuleType: "cc_prebuilt_library",
55 linkTypes: []string{"static", "shared"},
56}
57
Paul Duffin255f18e2019-12-13 11:22:16 +000058func init() {
59 // Register sdk member types.
Paul Duffina0843f62019-12-13 19:50:38 +000060 android.RegisterSdkMemberType(sharedLibrarySdkMemberType)
61 android.RegisterSdkMemberType(staticLibrarySdkMemberType)
Paul Duffin9b76c0b2020-03-12 10:24:35 +000062 android.RegisterSdkMemberType(staticAndSharedLibrarySdkMemberType)
Paul Duffin2f6bc092019-12-13 10:40:56 +000063}
64
65type librarySdkMemberType struct {
Paul Duffin255f18e2019-12-13 11:22:16 +000066 android.SdkMemberTypeBase
67
Paul Duffin2f6bc092019-12-13 10:40:56 +000068 prebuiltModuleType string
69
Martin Stjernholmcd07bce2020-03-10 22:37:59 +000070 noOutputFiles bool // True if there are no srcs files.
71
72 // The set of link types supported. A set of "static", "shared", or nil to
73 // skip link type variations.
Paul Duffin2f6bc092019-12-13 10:40:56 +000074 linkTypes []string
75}
76
77func (mt *librarySdkMemberType) AddDependencies(mctx android.BottomUpMutatorContext, dependencyTag blueprint.DependencyTag, names []string) {
78 targets := mctx.MultiTargets()
79 for _, lib := range names {
80 for _, target := range targets {
81 name, version := StubsLibNameAndVersion(lib)
82 if version == "" {
83 version = LatestStubsVersionFor(mctx.Config(), name)
84 }
Colin Cross42507332020-08-21 16:15:23 -070085 variations := target.Variations()
86 if mctx.Device() {
87 variations = append(variations,
88 blueprint.Variation{Mutator: "image", Variation: android.CoreVariation},
89 blueprint.Variation{Mutator: "version", Variation: version})
90 }
Paul Duffin91756d22020-02-21 16:29:57 +000091 if mt.linkTypes == nil {
Colin Cross42507332020-08-21 16:15:23 -070092 mctx.AddFarVariationDependencies(variations, dependencyTag, name)
Paul Duffin91756d22020-02-21 16:29:57 +000093 } else {
94 for _, linkType := range mt.linkTypes {
Colin Cross42507332020-08-21 16:15:23 -070095 libVariations := append(variations,
96 blueprint.Variation{Mutator: "link", Variation: linkType})
97 mctx.AddFarVariationDependencies(libVariations, dependencyTag, name)
Paul Duffin91756d22020-02-21 16:29:57 +000098 }
Paul Duffin2f6bc092019-12-13 10:40:56 +000099 }
100 }
101 }
102}
103
104func (mt *librarySdkMemberType) IsInstance(module android.Module) bool {
Paul Duffina0843f62019-12-13 19:50:38 +0000105 // Check the module to see if it can be used with this module type.
106 if m, ok := module.(*Module); ok {
107 for _, allowableMemberType := range m.sdkMemberTypes {
108 if allowableMemberType == mt {
109 return true
110 }
111 }
112 }
113
114 return false
Paul Duffin2f6bc092019-12-13 10:40:56 +0000115}
116
Paul Duffin3a4eb502020-03-19 16:11:18 +0000117func (mt *librarySdkMemberType) AddPrebuiltModule(ctx android.SdkMemberContext, member android.SdkMember) android.BpModule {
118 pbm := ctx.SnapshotBuilder().AddPrebuiltModule(member, mt.prebuiltModuleType)
Paul Duffin0c394f32020-03-05 14:09:58 +0000119
120 ccModule := member.Variants()[0].(*Module)
121
Paul Duffind1edbd42020-08-13 19:45:31 +0100122 if proptools.Bool(ccModule.VendorProperties.Vendor_available) {
123 pbm.AddProperty("vendor_available", true)
124 }
125
Paul Duffin0c394f32020-03-05 14:09:58 +0000126 sdkVersion := ccModule.SdkVersion()
127 if sdkVersion != "" {
128 pbm.AddProperty("sdk_version", sdkVersion)
129 }
Paul Duffin2f6bc092019-12-13 10:40:56 +0000130
Paul Duffin13f02712020-03-06 12:30:43 +0000131 stl := ccModule.stl.Properties.Stl
132 if stl != nil {
Paul Duffin0174d8d2020-03-11 18:42:08 +0000133 pbm.AddProperty("stl", proptools.String(stl))
Paul Duffin13f02712020-03-06 12:30:43 +0000134 }
Martin Stjernholm47ed3522020-06-17 22:52:25 +0100135
136 if lib, ok := ccModule.linker.(*libraryDecorator); ok {
137 uhs := lib.Properties.Unique_host_soname
138 if uhs != nil {
139 pbm.AddProperty("unique_host_soname", proptools.Bool(uhs))
140 }
141 }
142
Paul Duffin0174d8d2020-03-11 18:42:08 +0000143 return pbm
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000144}
Paul Duffin2f6bc092019-12-13 10:40:56 +0000145
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000146func (mt *librarySdkMemberType) CreateVariantPropertiesStruct() android.SdkMemberProperties {
147 return &nativeLibInfoProperties{memberType: mt}
Paul Duffin2f6bc092019-12-13 10:40:56 +0000148}
149
150func isGeneratedHeaderDirectory(p android.Path) bool {
151 _, gen := p.(android.WritablePath)
152 return gen
153}
154
Paul Duffin64f54b02020-02-20 14:33:54 +0000155type includeDirsProperty struct {
156 // Accessor to retrieve the paths
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000157 pathsGetter func(libInfo *nativeLibInfoProperties) android.Paths
Paul Duffin64f54b02020-02-20 14:33:54 +0000158
159 // The name of the property in the prebuilt library, "" means there is no property.
160 propertyName string
161
162 // The directory within the snapshot directory into which items should be copied.
163 snapshotDir string
164
165 // True if the items on the path should be copied.
166 copy bool
167
168 // True if the paths represent directories, files if they represent files.
169 dirs bool
Paul Duffin74fc1902020-01-23 11:45:03 +0000170}
171
Paul Duffin64f54b02020-02-20 14:33:54 +0000172var includeDirProperties = []includeDirsProperty{
173 {
174 // ExportedIncludeDirs lists directories that contains some header files to be
175 // copied into a directory in the snapshot. The snapshot directories must be added to
176 // the export_include_dirs property in the prebuilt module in the snapshot.
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000177 pathsGetter: func(libInfo *nativeLibInfoProperties) android.Paths { return libInfo.ExportedIncludeDirs },
Paul Duffin64f54b02020-02-20 14:33:54 +0000178 propertyName: "export_include_dirs",
179 snapshotDir: nativeIncludeDir,
180 copy: true,
181 dirs: true,
182 },
183 {
184 // ExportedSystemIncludeDirs lists directories that contains some system header files to
185 // be copied into a directory in the snapshot. The snapshot directories must be added to
186 // the export_system_include_dirs property in the prebuilt module in the snapshot.
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000187 pathsGetter: func(libInfo *nativeLibInfoProperties) android.Paths { return libInfo.ExportedSystemIncludeDirs },
Paul Duffin64f54b02020-02-20 14:33:54 +0000188 propertyName: "export_system_include_dirs",
189 snapshotDir: nativeIncludeDir,
190 copy: true,
191 dirs: true,
192 },
193 {
194 // exportedGeneratedIncludeDirs lists directories that contains some header files
195 // that are explicitly listed in the exportedGeneratedHeaders property. So, the contents
196 // of these directories do not need to be copied, but these directories do need adding to
197 // the export_include_dirs property in the prebuilt module in the snapshot.
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000198 pathsGetter: func(libInfo *nativeLibInfoProperties) android.Paths { return libInfo.exportedGeneratedIncludeDirs },
Paul Duffin64f54b02020-02-20 14:33:54 +0000199 propertyName: "export_include_dirs",
200 snapshotDir: nativeGeneratedIncludeDir,
201 copy: false,
202 dirs: true,
203 },
204 {
205 // exportedGeneratedHeaders lists header files that are in one of the directories
206 // specified in exportedGeneratedIncludeDirs must be copied into the snapshot.
207 // As they are in a directory in exportedGeneratedIncludeDirs they do not need adding to a
208 // property in the prebuilt module in the snapshot.
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000209 pathsGetter: func(libInfo *nativeLibInfoProperties) android.Paths { return libInfo.exportedGeneratedHeaders },
Paul Duffin64f54b02020-02-20 14:33:54 +0000210 propertyName: "",
211 snapshotDir: nativeGeneratedIncludeDir,
212 copy: true,
213 dirs: false,
214 },
215}
216
217// Add properties that may, or may not, be arch specific.
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000218func addPossiblyArchSpecificProperties(sdkModuleContext android.ModuleContext, builder android.SnapshotBuilder, libInfo *nativeLibInfoProperties, outputProperties android.BpPropertySet) {
219
Martin Stjernholmfbb486f2020-08-21 18:43:51 +0100220 if libInfo.SanitizeNever {
221 sanitizeSet := outputProperties.AddPropertySet("sanitize")
222 sanitizeSet.AddProperty("never", true)
223 }
224
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000225 // Copy the generated library to the snapshot and add a reference to it in the .bp module.
226 if libInfo.outputFile != nil {
227 nativeLibraryPath := nativeLibraryPathFor(libInfo)
228 builder.CopyToSnapshot(libInfo.outputFile, nativeLibraryPath)
229 outputProperties.AddProperty("srcs", []string{nativeLibraryPath})
230 }
Paul Duffin64f54b02020-02-20 14:33:54 +0000231
Paul Duffin13f02712020-03-06 12:30:43 +0000232 if len(libInfo.SharedLibs) > 0 {
233 outputProperties.AddPropertyWithTag("shared_libs", libInfo.SharedLibs, builder.SdkMemberReferencePropertyTag(false))
234 }
235
Martin Stjernholm10566a02020-03-24 01:19:52 +0000236 // SystemSharedLibs needs to be propagated if it's a list, even if it's empty,
237 // so check for non-nil instead of nonzero length.
238 if libInfo.SystemSharedLibs != nil {
Paul Duffin13f02712020-03-06 12:30:43 +0000239 outputProperties.AddPropertyWithTag("system_shared_libs", libInfo.SystemSharedLibs, builder.SdkMemberReferencePropertyTag(false))
240 }
241
Paul Duffin64f54b02020-02-20 14:33:54 +0000242 // Map from property name to the include dirs to add to the prebuilt module in the snapshot.
243 includeDirs := make(map[string][]string)
244
245 // Iterate over each include directory property, copying files and collating property
246 // values where necessary.
247 for _, propertyInfo := range includeDirProperties {
248 // Calculate the base directory in the snapshot into which the files will be copied.
249 // lib.ArchType is "" for common properties.
Paul Duffined62b9c2020-06-16 16:12:50 +0100250 targetDir := filepath.Join(libInfo.OsPrefix(), libInfo.archType, propertyInfo.snapshotDir)
Paul Duffin64f54b02020-02-20 14:33:54 +0000251
252 propertyName := propertyInfo.propertyName
253
254 // Iterate over each path in one of the include directory properties.
255 for _, path := range propertyInfo.pathsGetter(libInfo) {
256
257 // Copy the files/directories when necessary.
258 if propertyInfo.copy {
259 if propertyInfo.dirs {
260 // When copying a directory glob and copy all the headers within it.
261 // TODO(jiyong) copy headers having other suffixes
262 headers, _ := sdkModuleContext.GlobWithDeps(path.String()+"/**/*.h", nil)
263 for _, file := range headers {
264 src := android.PathForSource(sdkModuleContext, file)
265 dest := filepath.Join(targetDir, file)
266 builder.CopyToSnapshot(src, dest)
267 }
268 } else {
269 // Otherwise, just copy the files.
270 dest := filepath.Join(targetDir, libInfo.name, path.Rel())
271 builder.CopyToSnapshot(path, dest)
272 }
273 }
274
275 // Only directories are added to a property.
276 if propertyInfo.dirs {
277 var snapshotPath string
278 if isGeneratedHeaderDirectory(path) {
279 snapshotPath = filepath.Join(targetDir, libInfo.name)
280 } else {
281 snapshotPath = filepath.Join(targetDir, path.String())
282 }
283
284 includeDirs[propertyName] = append(includeDirs[propertyName], snapshotPath)
285 }
286 }
Paul Duffin74fc1902020-01-23 11:45:03 +0000287 }
Paul Duffin64f54b02020-02-20 14:33:54 +0000288
289 // Add the collated include dir properties to the output.
290 for property, dirs := range includeDirs {
291 outputProperties.AddProperty(property, dirs)
Paul Duffin74fc1902020-01-23 11:45:03 +0000292 }
Martin Stjernholmc5dd4f72020-04-01 20:38:01 +0100293
294 if len(libInfo.StubsVersion) > 0 {
Martin Stjernholmc5dd4f72020-04-01 20:38:01 +0100295 stubsSet := outputProperties.AddPropertySet("stubs")
Martin Stjernholmc5dd4f72020-04-01 20:38:01 +0100296 stubsSet.AddProperty("versions", []string{libInfo.StubsVersion})
297 }
Paul Duffin74fc1902020-01-23 11:45:03 +0000298}
299
Paul Duffin2f6bc092019-12-13 10:40:56 +0000300const (
301 nativeIncludeDir = "include"
302 nativeGeneratedIncludeDir = "include_gen"
303 nativeStubDir = "lib"
304)
305
306// path to the native library. Relative to <sdk_root>/<api_dir>
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000307func nativeLibraryPathFor(lib *nativeLibInfoProperties) string {
Paul Duffina04c1072020-03-02 10:16:35 +0000308 return filepath.Join(lib.OsPrefix(), lib.archType,
Paul Duffin2f6bc092019-12-13 10:40:56 +0000309 nativeStubDir, lib.outputFile.Base())
310}
311
Paul Duffin2f6bc092019-12-13 10:40:56 +0000312// nativeLibInfoProperties represents properties of a native lib
313//
314// The exported (capitalized) fields will be examined and may be changed during common value extraction.
315// The unexported fields will be left untouched.
316type nativeLibInfoProperties struct {
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000317 android.SdkMemberPropertiesBase
318
319 memberType *librarySdkMemberType
320
Paul Duffin2f6bc092019-12-13 10:40:56 +0000321 // The name of the library, is not exported as this must not be changed during optimization.
322 name string
323
324 // archType is not exported as if set (to a non default value) it is always arch specific.
325 // This is "" for common properties.
326 archType string
327
Paul Duffin5efd1982020-02-20 14:33:54 +0000328 // The list of possibly common exported include dirs.
329 //
330 // This field is exported as its contents may not be arch specific.
Paul Duffin864e1b42020-05-06 10:23:19 +0100331 ExportedIncludeDirs android.Paths `android:"arch_variant"`
Paul Duffin2f6bc092019-12-13 10:40:56 +0000332
Paul Duffin5efd1982020-02-20 14:33:54 +0000333 // The list of arch specific exported generated include dirs.
334 //
335 // This field is not exported as its contents are always arch specific.
336 exportedGeneratedIncludeDirs android.Paths
337
338 // The list of arch specific exported generated header files.
339 //
340 // This field is not exported as its contents are is always arch specific.
Paul Duffin2f6bc092019-12-13 10:40:56 +0000341 exportedGeneratedHeaders android.Paths
342
Paul Duffin5efd1982020-02-20 14:33:54 +0000343 // The list of possibly common exported system include dirs.
344 //
345 // This field is exported as its contents may not be arch specific.
Paul Duffin864e1b42020-05-06 10:23:19 +0100346 ExportedSystemIncludeDirs android.Paths `android:"arch_variant"`
Paul Duffin5efd1982020-02-20 14:33:54 +0000347
348 // The list of possibly common exported flags.
349 //
350 // This field is exported as its contents may not be arch specific.
Paul Duffin864e1b42020-05-06 10:23:19 +0100351 ExportedFlags []string `android:"arch_variant"`
Paul Duffin5efd1982020-02-20 14:33:54 +0000352
Paul Duffin13f02712020-03-06 12:30:43 +0000353 // The set of shared libraries
354 //
355 // This field is exported as its contents may not be arch specific.
Paul Duffin864e1b42020-05-06 10:23:19 +0100356 SharedLibs []string `android:"arch_variant"`
Paul Duffin13f02712020-03-06 12:30:43 +0000357
Martin Stjernholm10566a02020-03-24 01:19:52 +0000358 // The set of system shared libraries. Note nil and [] are semantically
359 // distinct - see BaseLinkerProperties.System_shared_libs.
Paul Duffin13f02712020-03-06 12:30:43 +0000360 //
361 // This field is exported as its contents may not be arch specific.
Paul Duffin864e1b42020-05-06 10:23:19 +0100362 SystemSharedLibs []string `android:"arch_variant"`
Paul Duffin13f02712020-03-06 12:30:43 +0000363
Martin Stjernholmc5dd4f72020-04-01 20:38:01 +0100364 // The specific stubs version for the lib variant, or empty string if stubs
365 // are not in use.
Paul Duffin7a1f7f32020-05-04 15:32:08 +0100366 //
367 // Marked 'ignored-on-host' as the StubsVersion() from which this is initialized is
368 // not set on host and the stubs.versions property which this is written to is does
369 // not vary by arch so cannot be android specific.
370 StubsVersion string `sdk:"ignored-on-host"`
Martin Stjernholmc5dd4f72020-04-01 20:38:01 +0100371
Martin Stjernholmfbb486f2020-08-21 18:43:51 +0100372 // Value of SanitizeProperties.Sanitize.Never. Needs to be propagated for CRT objects.
373 SanitizeNever bool `android:"arch_variant"`
374
Paul Duffin2f6bc092019-12-13 10:40:56 +0000375 // outputFile is not exported as it is always arch specific.
376 outputFile android.Path
377}
378
Paul Duffin3a4eb502020-03-19 16:11:18 +0000379func (p *nativeLibInfoProperties) PopulateFromVariant(ctx android.SdkMemberContext, variant android.Module) {
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000380 ccModule := variant.(*Module)
381
382 // If the library has some link types then it produces an output binary file, otherwise it
383 // is header only.
Martin Stjernholmcd07bce2020-03-10 22:37:59 +0000384 if !p.memberType.noOutputFiles {
Paul Duffin712993c2020-05-05 14:11:57 +0100385 p.outputFile = getRequiredMemberOutputFile(ctx, ccModule)
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000386 }
387
388 // Separate out the generated include dirs (which are arch specific) from the
389 // include dirs (which may not be).
390 exportedIncludeDirs, exportedGeneratedIncludeDirs := android.FilterPathListPredicate(
391 ccModule.ExportedIncludeDirs(), isGeneratedHeaderDirectory)
392
393 p.name = variant.Name()
394 p.archType = ccModule.Target().Arch.ArchType.String()
Paul Duffin9b76c0b2020-03-12 10:24:35 +0000395
396 // Make sure that the include directories are unique.
397 p.ExportedIncludeDirs = android.FirstUniquePaths(exportedIncludeDirs)
398 p.exportedGeneratedIncludeDirs = android.FirstUniquePaths(exportedGeneratedIncludeDirs)
Paul Duffinab5467d2020-06-18 16:31:04 +0100399
400 // Take a copy before filtering out duplicates to avoid changing the slice owned by the
401 // ccModule.
402 dirs := append(android.Paths(nil), ccModule.ExportedSystemIncludeDirs()...)
403 p.ExportedSystemIncludeDirs = android.FirstUniquePaths(dirs)
Paul Duffin9b76c0b2020-03-12 10:24:35 +0000404
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000405 p.ExportedFlags = ccModule.ExportedFlags()
Paul Duffin13f02712020-03-06 12:30:43 +0000406 if ccModule.linker != nil {
407 specifiedDeps := specifiedDeps{}
408 specifiedDeps = ccModule.linker.linkerSpecifiedDeps(specifiedDeps)
409
Martin Stjernholmcc330d62020-04-21 20:45:35 +0100410 if !ccModule.HasStubsVariants() {
411 // Propagate dynamic dependencies for implementation libs, but not stubs.
412 p.SharedLibs = specifiedDeps.sharedLibs
413 }
Paul Duffin13f02712020-03-06 12:30:43 +0000414 p.SystemSharedLibs = specifiedDeps.systemSharedLibs
415 }
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000416 p.exportedGeneratedHeaders = ccModule.ExportedGeneratedHeaders()
Martin Stjernholmc5dd4f72020-04-01 20:38:01 +0100417
418 if ccModule.HasStubsVariants() {
419 p.StubsVersion = ccModule.StubsVersion()
Martin Stjernholmc5dd4f72020-04-01 20:38:01 +0100420 }
Martin Stjernholmfbb486f2020-08-21 18:43:51 +0100421
422 if ccModule.sanitize != nil && proptools.Bool(ccModule.sanitize.Properties.Sanitize.Never) {
423 p.SanitizeNever = true
424 }
Paul Duffin88f2fbe2020-02-27 16:00:53 +0000425}
426
Paul Duffin712993c2020-05-05 14:11:57 +0100427func getRequiredMemberOutputFile(ctx android.SdkMemberContext, ccModule *Module) android.Path {
428 var path android.Path
429 outputFile := ccModule.OutputFile()
430 if outputFile.Valid() {
431 path = outputFile.Path()
432 } else {
433 ctx.SdkModuleContext().ModuleErrorf("member variant %s does not have a valid output file", ccModule)
434 }
435 return path
436}
437
Paul Duffin3a4eb502020-03-19 16:11:18 +0000438func (p *nativeLibInfoProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) {
439 addPossiblyArchSpecificProperties(ctx.SdkModuleContext(), ctx.SnapshotBuilder(), p, propertySet)
Paul Duffin2f6bc092019-12-13 10:40:56 +0000440}