Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 1 | // 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 | |
| 15 | package cc |
| 16 | |
| 17 | import ( |
| 18 | "path/filepath" |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 19 | |
| 20 | "android/soong/android" |
| 21 | "github.com/google/blueprint" |
Paul Duffin | 206433a | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 22 | "github.com/google/blueprint/proptools" |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 23 | ) |
| 24 | |
| 25 | // This file contains support for using cc library modules within an sdk. |
| 26 | |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 27 | var sharedLibrarySdkMemberType = &librarySdkMemberType{ |
| 28 | SdkMemberTypeBase: android.SdkMemberTypeBase{ |
| 29 | PropertyName: "native_shared_libs", |
Paul Duffin | e602918 | 2019-12-16 17:43:48 +0000 | [diff] [blame] | 30 | SupportsSdk: true, |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 31 | }, |
| 32 | prebuiltModuleType: "cc_prebuilt_library_shared", |
| 33 | linkTypes: []string{"shared"}, |
| 34 | } |
| 35 | |
| 36 | var staticLibrarySdkMemberType = &librarySdkMemberType{ |
| 37 | SdkMemberTypeBase: android.SdkMemberTypeBase{ |
| 38 | PropertyName: "native_static_libs", |
Paul Duffin | e602918 | 2019-12-16 17:43:48 +0000 | [diff] [blame] | 39 | SupportsSdk: true, |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 40 | }, |
| 41 | prebuiltModuleType: "cc_prebuilt_library_static", |
| 42 | linkTypes: []string{"static"}, |
| 43 | } |
| 44 | |
Paul Duffin | 6cb8f17 | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 45 | var staticAndSharedLibrarySdkMemberType = &librarySdkMemberType{ |
| 46 | SdkMemberTypeBase: android.SdkMemberTypeBase{ |
| 47 | PropertyName: "native_libs", |
| 48 | SupportsSdk: true, |
| 49 | }, |
| 50 | prebuiltModuleType: "cc_prebuilt_library", |
| 51 | linkTypes: []string{"static", "shared"}, |
| 52 | } |
| 53 | |
Paul Duffin | 255f18e | 2019-12-13 11:22:16 +0000 | [diff] [blame] | 54 | func init() { |
| 55 | // Register sdk member types. |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 56 | android.RegisterSdkMemberType(sharedLibrarySdkMemberType) |
| 57 | android.RegisterSdkMemberType(staticLibrarySdkMemberType) |
Paul Duffin | 6cb8f17 | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 58 | android.RegisterSdkMemberType(staticAndSharedLibrarySdkMemberType) |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | type librarySdkMemberType struct { |
Paul Duffin | 255f18e | 2019-12-13 11:22:16 +0000 | [diff] [blame] | 62 | android.SdkMemberTypeBase |
| 63 | |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 64 | prebuiltModuleType string |
| 65 | |
| 66 | // The set of link types supported, set of "static", "shared". |
| 67 | linkTypes []string |
| 68 | } |
| 69 | |
| 70 | func (mt *librarySdkMemberType) AddDependencies(mctx android.BottomUpMutatorContext, dependencyTag blueprint.DependencyTag, names []string) { |
| 71 | targets := mctx.MultiTargets() |
| 72 | for _, lib := range names { |
| 73 | for _, target := range targets { |
| 74 | name, version := StubsLibNameAndVersion(lib) |
| 75 | if version == "" { |
| 76 | version = LatestStubsVersionFor(mctx.Config(), name) |
| 77 | } |
Paul Duffin | 132e66f | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 78 | if mt.linkTypes == nil { |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 79 | mctx.AddFarVariationDependencies(append(target.Variations(), []blueprint.Variation{ |
| 80 | {Mutator: "image", Variation: android.CoreVariation}, |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 81 | {Mutator: "version", Variation: version}, |
| 82 | }...), dependencyTag, name) |
Paul Duffin | 132e66f | 2020-02-21 16:29:57 +0000 | [diff] [blame] | 83 | } else { |
| 84 | for _, linkType := range mt.linkTypes { |
| 85 | mctx.AddFarVariationDependencies(append(target.Variations(), []blueprint.Variation{ |
| 86 | {Mutator: "image", Variation: android.CoreVariation}, |
| 87 | {Mutator: "link", Variation: linkType}, |
| 88 | {Mutator: "version", Variation: version}, |
| 89 | }...), dependencyTag, name) |
| 90 | } |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 91 | } |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | func (mt *librarySdkMemberType) IsInstance(module android.Module) bool { |
Paul Duffin | a0843f6 | 2019-12-13 19:50:38 +0000 | [diff] [blame] | 97 | // Check the module to see if it can be used with this module type. |
| 98 | if m, ok := module.(*Module); ok { |
| 99 | for _, allowableMemberType := range m.sdkMemberTypes { |
| 100 | if allowableMemberType == mt { |
| 101 | return true |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | return false |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 107 | } |
| 108 | |
Paul Duffin | 17ab883 | 2020-03-19 16:11:18 +0000 | [diff] [blame] | 109 | func (mt *librarySdkMemberType) AddPrebuiltModule(ctx android.SdkMemberContext, member android.SdkMember) android.BpModule { |
| 110 | pbm := ctx.SnapshotBuilder().AddPrebuiltModule(member, mt.prebuiltModuleType) |
Paul Duffin | 8fa6acf | 2020-03-05 14:09:58 +0000 | [diff] [blame] | 111 | |
| 112 | ccModule := member.Variants()[0].(*Module) |
| 113 | |
| 114 | sdkVersion := ccModule.SdkVersion() |
| 115 | if sdkVersion != "" { |
| 116 | pbm.AddProperty("sdk_version", sdkVersion) |
| 117 | } |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 118 | |
Paul Duffin | 206433a | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 119 | stl := ccModule.stl.Properties.Stl |
| 120 | if stl != nil { |
Paul Duffin | 2bdbe83 | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 121 | pbm.AddProperty("stl", proptools.String(stl)) |
Paul Duffin | 206433a | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 122 | } |
Paul Duffin | 2bdbe83 | 2020-03-11 18:42:08 +0000 | [diff] [blame] | 123 | return pbm |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 124 | } |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 125 | |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 126 | func (mt *librarySdkMemberType) CreateVariantPropertiesStruct() android.SdkMemberProperties { |
| 127 | return &nativeLibInfoProperties{memberType: mt} |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | func isGeneratedHeaderDirectory(p android.Path) bool { |
| 131 | _, gen := p.(android.WritablePath) |
| 132 | return gen |
| 133 | } |
| 134 | |
Paul Duffin | ce5881f | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 135 | type includeDirsProperty struct { |
| 136 | // Accessor to retrieve the paths |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 137 | pathsGetter func(libInfo *nativeLibInfoProperties) android.Paths |
Paul Duffin | ce5881f | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 138 | |
| 139 | // The name of the property in the prebuilt library, "" means there is no property. |
| 140 | propertyName string |
| 141 | |
| 142 | // The directory within the snapshot directory into which items should be copied. |
| 143 | snapshotDir string |
| 144 | |
| 145 | // True if the items on the path should be copied. |
| 146 | copy bool |
| 147 | |
| 148 | // True if the paths represent directories, files if they represent files. |
| 149 | dirs bool |
Paul Duffin | 74fc190 | 2020-01-23 11:45:03 +0000 | [diff] [blame] | 150 | } |
| 151 | |
Paul Duffin | ce5881f | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 152 | var includeDirProperties = []includeDirsProperty{ |
| 153 | { |
| 154 | // ExportedIncludeDirs lists directories that contains some header files to be |
| 155 | // copied into a directory in the snapshot. The snapshot directories must be added to |
| 156 | // the export_include_dirs property in the prebuilt module in the snapshot. |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 157 | pathsGetter: func(libInfo *nativeLibInfoProperties) android.Paths { return libInfo.ExportedIncludeDirs }, |
Paul Duffin | ce5881f | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 158 | propertyName: "export_include_dirs", |
| 159 | snapshotDir: nativeIncludeDir, |
| 160 | copy: true, |
| 161 | dirs: true, |
| 162 | }, |
| 163 | { |
| 164 | // ExportedSystemIncludeDirs lists directories that contains some system header files to |
| 165 | // be copied into a directory in the snapshot. The snapshot directories must be added to |
| 166 | // the export_system_include_dirs property in the prebuilt module in the snapshot. |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 167 | pathsGetter: func(libInfo *nativeLibInfoProperties) android.Paths { return libInfo.ExportedSystemIncludeDirs }, |
Paul Duffin | ce5881f | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 168 | propertyName: "export_system_include_dirs", |
| 169 | snapshotDir: nativeIncludeDir, |
| 170 | copy: true, |
| 171 | dirs: true, |
| 172 | }, |
| 173 | { |
| 174 | // exportedGeneratedIncludeDirs lists directories that contains some header files |
| 175 | // that are explicitly listed in the exportedGeneratedHeaders property. So, the contents |
| 176 | // of these directories do not need to be copied, but these directories do need adding to |
| 177 | // the export_include_dirs property in the prebuilt module in the snapshot. |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 178 | pathsGetter: func(libInfo *nativeLibInfoProperties) android.Paths { return libInfo.exportedGeneratedIncludeDirs }, |
Paul Duffin | ce5881f | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 179 | propertyName: "export_include_dirs", |
| 180 | snapshotDir: nativeGeneratedIncludeDir, |
| 181 | copy: false, |
| 182 | dirs: true, |
| 183 | }, |
| 184 | { |
| 185 | // exportedGeneratedHeaders lists header files that are in one of the directories |
| 186 | // specified in exportedGeneratedIncludeDirs must be copied into the snapshot. |
| 187 | // As they are in a directory in exportedGeneratedIncludeDirs they do not need adding to a |
| 188 | // property in the prebuilt module in the snapshot. |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 189 | pathsGetter: func(libInfo *nativeLibInfoProperties) android.Paths { return libInfo.exportedGeneratedHeaders }, |
Paul Duffin | ce5881f | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 190 | propertyName: "", |
| 191 | snapshotDir: nativeGeneratedIncludeDir, |
| 192 | copy: true, |
| 193 | dirs: false, |
| 194 | }, |
| 195 | } |
| 196 | |
| 197 | // Add properties that may, or may not, be arch specific. |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 198 | func addPossiblyArchSpecificProperties(sdkModuleContext android.ModuleContext, builder android.SnapshotBuilder, libInfo *nativeLibInfoProperties, outputProperties android.BpPropertySet) { |
| 199 | |
| 200 | // Copy the generated library to the snapshot and add a reference to it in the .bp module. |
| 201 | if libInfo.outputFile != nil { |
| 202 | nativeLibraryPath := nativeLibraryPathFor(libInfo) |
| 203 | builder.CopyToSnapshot(libInfo.outputFile, nativeLibraryPath) |
| 204 | outputProperties.AddProperty("srcs", []string{nativeLibraryPath}) |
| 205 | } |
Paul Duffin | ce5881f | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 206 | |
Paul Duffin | 206433a | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 207 | if len(libInfo.SharedLibs) > 0 { |
| 208 | outputProperties.AddPropertyWithTag("shared_libs", libInfo.SharedLibs, builder.SdkMemberReferencePropertyTag(false)) |
| 209 | } |
| 210 | |
| 211 | if len(libInfo.SystemSharedLibs) > 0 { |
| 212 | outputProperties.AddPropertyWithTag("system_shared_libs", libInfo.SystemSharedLibs, builder.SdkMemberReferencePropertyTag(false)) |
| 213 | } |
| 214 | |
Paul Duffin | ce5881f | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 215 | // Map from property name to the include dirs to add to the prebuilt module in the snapshot. |
| 216 | includeDirs := make(map[string][]string) |
| 217 | |
| 218 | // Iterate over each include directory property, copying files and collating property |
| 219 | // values where necessary. |
| 220 | for _, propertyInfo := range includeDirProperties { |
| 221 | // Calculate the base directory in the snapshot into which the files will be copied. |
| 222 | // lib.ArchType is "" for common properties. |
| 223 | targetDir := filepath.Join(libInfo.archType, propertyInfo.snapshotDir) |
| 224 | |
| 225 | propertyName := propertyInfo.propertyName |
| 226 | |
| 227 | // Iterate over each path in one of the include directory properties. |
| 228 | for _, path := range propertyInfo.pathsGetter(libInfo) { |
| 229 | |
| 230 | // Copy the files/directories when necessary. |
| 231 | if propertyInfo.copy { |
| 232 | if propertyInfo.dirs { |
| 233 | // When copying a directory glob and copy all the headers within it. |
| 234 | // TODO(jiyong) copy headers having other suffixes |
| 235 | headers, _ := sdkModuleContext.GlobWithDeps(path.String()+"/**/*.h", nil) |
| 236 | for _, file := range headers { |
| 237 | src := android.PathForSource(sdkModuleContext, file) |
| 238 | dest := filepath.Join(targetDir, file) |
| 239 | builder.CopyToSnapshot(src, dest) |
| 240 | } |
| 241 | } else { |
| 242 | // Otherwise, just copy the files. |
| 243 | dest := filepath.Join(targetDir, libInfo.name, path.Rel()) |
| 244 | builder.CopyToSnapshot(path, dest) |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | // Only directories are added to a property. |
| 249 | if propertyInfo.dirs { |
| 250 | var snapshotPath string |
| 251 | if isGeneratedHeaderDirectory(path) { |
| 252 | snapshotPath = filepath.Join(targetDir, libInfo.name) |
| 253 | } else { |
| 254 | snapshotPath = filepath.Join(targetDir, path.String()) |
| 255 | } |
| 256 | |
| 257 | includeDirs[propertyName] = append(includeDirs[propertyName], snapshotPath) |
| 258 | } |
| 259 | } |
Paul Duffin | 74fc190 | 2020-01-23 11:45:03 +0000 | [diff] [blame] | 260 | } |
Paul Duffin | ce5881f | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 261 | |
| 262 | // Add the collated include dir properties to the output. |
| 263 | for property, dirs := range includeDirs { |
| 264 | outputProperties.AddProperty(property, dirs) |
Paul Duffin | 74fc190 | 2020-01-23 11:45:03 +0000 | [diff] [blame] | 265 | } |
Paul Duffin | 74fc190 | 2020-01-23 11:45:03 +0000 | [diff] [blame] | 266 | } |
| 267 | |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 268 | const ( |
| 269 | nativeIncludeDir = "include" |
| 270 | nativeGeneratedIncludeDir = "include_gen" |
| 271 | nativeStubDir = "lib" |
| 272 | ) |
| 273 | |
| 274 | // path to the native library. Relative to <sdk_root>/<api_dir> |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 275 | func nativeLibraryPathFor(lib *nativeLibInfoProperties) string { |
Paul Duffin | 9b358d7 | 2020-03-02 10:16:35 +0000 | [diff] [blame] | 276 | return filepath.Join(lib.OsPrefix(), lib.archType, |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 277 | nativeStubDir, lib.outputFile.Base()) |
| 278 | } |
| 279 | |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 280 | // nativeLibInfoProperties represents properties of a native lib |
| 281 | // |
| 282 | // The exported (capitalized) fields will be examined and may be changed during common value extraction. |
| 283 | // The unexported fields will be left untouched. |
| 284 | type nativeLibInfoProperties struct { |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 285 | android.SdkMemberPropertiesBase |
| 286 | |
| 287 | memberType *librarySdkMemberType |
| 288 | |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 289 | // The name of the library, is not exported as this must not be changed during optimization. |
| 290 | name string |
| 291 | |
| 292 | // archType is not exported as if set (to a non default value) it is always arch specific. |
| 293 | // This is "" for common properties. |
| 294 | archType string |
| 295 | |
Paul Duffin | 5efd198 | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 296 | // The list of possibly common exported include dirs. |
| 297 | // |
| 298 | // This field is exported as its contents may not be arch specific. |
| 299 | ExportedIncludeDirs android.Paths |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 300 | |
Paul Duffin | 5efd198 | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 301 | // The list of arch specific exported generated include dirs. |
| 302 | // |
| 303 | // This field is not exported as its contents are always arch specific. |
| 304 | exportedGeneratedIncludeDirs android.Paths |
| 305 | |
| 306 | // The list of arch specific exported generated header files. |
| 307 | // |
| 308 | // This field is not exported as its contents are is always arch specific. |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 309 | exportedGeneratedHeaders android.Paths |
| 310 | |
Paul Duffin | 5efd198 | 2020-02-20 14:33:54 +0000 | [diff] [blame] | 311 | // The list of possibly common exported system include dirs. |
| 312 | // |
| 313 | // This field is exported as its contents may not be arch specific. |
| 314 | ExportedSystemIncludeDirs android.Paths |
| 315 | |
| 316 | // The list of possibly common exported flags. |
| 317 | // |
| 318 | // This field is exported as its contents may not be arch specific. |
| 319 | ExportedFlags []string |
| 320 | |
Paul Duffin | 206433a | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 321 | // The set of shared libraries |
| 322 | // |
| 323 | // This field is exported as its contents may not be arch specific. |
| 324 | SharedLibs []string |
| 325 | |
| 326 | // The set of system shared libraries |
| 327 | // |
| 328 | // This field is exported as its contents may not be arch specific. |
| 329 | SystemSharedLibs []string |
| 330 | |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 331 | // outputFile is not exported as it is always arch specific. |
| 332 | outputFile android.Path |
| 333 | } |
| 334 | |
Paul Duffin | 17ab883 | 2020-03-19 16:11:18 +0000 | [diff] [blame] | 335 | func (p *nativeLibInfoProperties) PopulateFromVariant(ctx android.SdkMemberContext, variant android.Module) { |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 336 | ccModule := variant.(*Module) |
| 337 | |
| 338 | // If the library has some link types then it produces an output binary file, otherwise it |
| 339 | // is header only. |
| 340 | if p.memberType.linkTypes != nil { |
| 341 | p.outputFile = ccModule.OutputFile().Path() |
| 342 | } |
| 343 | |
| 344 | // Separate out the generated include dirs (which are arch specific) from the |
| 345 | // include dirs (which may not be). |
| 346 | exportedIncludeDirs, exportedGeneratedIncludeDirs := android.FilterPathListPredicate( |
| 347 | ccModule.ExportedIncludeDirs(), isGeneratedHeaderDirectory) |
| 348 | |
| 349 | p.name = variant.Name() |
| 350 | p.archType = ccModule.Target().Arch.ArchType.String() |
Paul Duffin | 6cb8f17 | 2020-03-12 10:24:35 +0000 | [diff] [blame] | 351 | |
| 352 | // Make sure that the include directories are unique. |
| 353 | p.ExportedIncludeDirs = android.FirstUniquePaths(exportedIncludeDirs) |
| 354 | p.exportedGeneratedIncludeDirs = android.FirstUniquePaths(exportedGeneratedIncludeDirs) |
| 355 | p.ExportedSystemIncludeDirs = android.FirstUniquePaths(ccModule.ExportedSystemIncludeDirs()) |
| 356 | |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 357 | p.ExportedFlags = ccModule.ExportedFlags() |
Paul Duffin | 206433a | 2020-03-06 12:30:43 +0000 | [diff] [blame] | 358 | if ccModule.linker != nil { |
| 359 | specifiedDeps := specifiedDeps{} |
| 360 | specifiedDeps = ccModule.linker.linkerSpecifiedDeps(specifiedDeps) |
| 361 | |
| 362 | p.SharedLibs = specifiedDeps.sharedLibs |
| 363 | p.SystemSharedLibs = specifiedDeps.systemSharedLibs |
| 364 | } |
Paul Duffin | 33cedcc | 2020-02-27 16:00:53 +0000 | [diff] [blame] | 365 | p.exportedGeneratedHeaders = ccModule.ExportedGeneratedHeaders() |
| 366 | } |
| 367 | |
Paul Duffin | 17ab883 | 2020-03-19 16:11:18 +0000 | [diff] [blame] | 368 | func (p *nativeLibInfoProperties) AddToPropertySet(ctx android.SdkMemberContext, propertySet android.BpPropertySet) { |
| 369 | addPossiblyArchSpecificProperties(ctx.SdkModuleContext(), ctx.SnapshotBuilder(), p, propertySet) |
Paul Duffin | 2f6bc09 | 2019-12-13 10:40:56 +0000 | [diff] [blame] | 370 | } |