Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 1 | // Copyright 2015 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 ( |
Dan Willemsen | 9775052 | 2016-02-09 17:43:51 -0800 | [diff] [blame] | 18 | "fmt" |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 19 | "io" |
Colin Cross | a234466 | 2016-03-24 13:14:12 -0700 | [diff] [blame] | 20 | "path/filepath" |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 21 | "strings" |
| 22 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 23 | "android/soong/android" |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 24 | ) |
| 25 | |
Jiyong Park | 27b188b | 2017-07-18 13:23:39 +0900 | [diff] [blame] | 26 | var ( |
Matthew Maurer | a61e31f | 2021-05-27 11:09:11 -0700 | [diff] [blame] | 27 | NativeBridgeSuffix = ".native_bridge" |
Matthew Maurer | 52af5b0 | 2021-05-27 10:01:36 -0700 | [diff] [blame] | 28 | ProductSuffix = ".product" |
Ivan Lozano | e6d3098 | 2021-02-05 10:57:43 -0500 | [diff] [blame] | 29 | VendorSuffix = ".vendor" |
Matthew Maurer | c686838 | 2021-07-13 14:12:37 -0700 | [diff] [blame] | 30 | RamdiskSuffix = ".ramdisk" |
Ivan Lozano | e6d3098 | 2021-02-05 10:57:43 -0500 | [diff] [blame] | 31 | VendorRamdiskSuffix = ".vendor_ramdisk" |
Matthew Maurer | 460ee94 | 2021-02-11 12:31:46 -0800 | [diff] [blame] | 32 | RecoverySuffix = ".recovery" |
Yifan Hong | 60e0cfb | 2020-10-21 15:17:56 -0700 | [diff] [blame] | 33 | sdkSuffix = ".sdk" |
Jiyong Park | 27b188b | 2017-07-18 13:23:39 +0900 | [diff] [blame] | 34 | ) |
| 35 | |
Dan Willemsen | f2c27d7 | 2016-07-13 16:50:22 -0700 | [diff] [blame] | 36 | type AndroidMkContext interface { |
Colin Cross | 0477b42 | 2020-10-13 18:43:54 -0700 | [diff] [blame] | 37 | BaseModuleName() string |
Dan Willemsen | f2c27d7 | 2016-07-13 16:50:22 -0700 | [diff] [blame] | 38 | Target() android.Target |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 39 | subAndroidMk(android.Config, *android.AndroidMkInfo, interface{}) |
Nicolas Geoffray | c22c1bf | 2019-01-15 19:53:23 +0000 | [diff] [blame] | 40 | Arch() android.Arch |
| 41 | Os() android.OsType |
| 42 | Host() bool |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 43 | UseVndk() bool |
Justin Yun | 5f7f7e8 | 2019-11-18 19:52:14 +0900 | [diff] [blame] | 44 | VndkVersion() string |
Jiyong Park | b078857 | 2018-12-20 22:10:17 +0900 | [diff] [blame] | 45 | static() bool |
Yifan Hong | 1b3348d | 2020-01-21 15:53:22 -0800 | [diff] [blame] | 46 | InRamdisk() bool |
Yifan Hong | 60e0cfb | 2020-10-21 15:17:56 -0700 | [diff] [blame] | 47 | InVendorRamdisk() bool |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 48 | InRecovery() bool |
Jiyong Park | f7c3bbe | 2020-12-09 21:18:56 +0900 | [diff] [blame] | 49 | NotInPlatform() bool |
Kiyoung Kim | aa39480 | 2024-01-08 12:55:45 +0900 | [diff] [blame] | 50 | InVendorOrProduct() bool |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 51 | ArchSpecific() bool |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 52 | } |
| 53 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 54 | type subAndroidMkProviderInfoProducer interface { |
| 55 | prepareAndroidMKProviderInfo(android.Config, AndroidMkContext, *android.AndroidMkInfo) |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 56 | } |
| 57 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 58 | type subAndroidMkFooterInfoProducer interface { |
| 59 | prepareAndroidMKFooterInfo(android.Config, AndroidMkContext, *android.AndroidMkInfo) |
| 60 | } |
| 61 | |
| 62 | func (c *Module) subAndroidMk(config android.Config, entries *android.AndroidMkInfo, obj interface{}) { |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 63 | if c.subAndroidMkOnce == nil { |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 64 | c.subAndroidMkOnce = make(map[subAndroidMkProviderInfoProducer]bool) |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 65 | } |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 66 | if androidmk, ok := obj.(subAndroidMkProviderInfoProducer); ok { |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 67 | if !c.subAndroidMkOnce[androidmk] { |
| 68 | c.subAndroidMkOnce[androidmk] = true |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 69 | androidmk.prepareAndroidMKProviderInfo(config, c, entries) |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 70 | } |
| 71 | } |
Dan Willemsen | f2c27d7 | 2016-07-13 16:50:22 -0700 | [diff] [blame] | 72 | } |
| 73 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 74 | var _ android.AndroidMkProviderInfoProducer = (*Module)(nil) |
| 75 | |
| 76 | func (c *Module) PrepareAndroidMKProviderInfo(config android.Config) *android.AndroidMkProviderInfo { |
Colin Cross | 56a8321 | 2020-09-15 18:30:11 -0700 | [diff] [blame] | 77 | if c.hideApexVariantFromMake || c.Properties.HideFromMake { |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 78 | return &android.AndroidMkProviderInfo{ |
| 79 | PrimaryInfo: android.AndroidMkInfo{ |
| 80 | Disabled: true, |
| 81 | }, |
| 82 | } |
Colin Cross | bc6fb16 | 2016-05-24 15:39:04 -0700 | [diff] [blame] | 83 | } |
| 84 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 85 | providerData := android.AndroidMkProviderInfo{ |
| 86 | PrimaryInfo: android.AndroidMkInfo{ |
| 87 | OutputFile: c.outputFile, |
| 88 | Required: c.Properties.AndroidMkRuntimeLibs, |
| 89 | OverrideName: c.BaseModuleName(), |
| 90 | Include: "$(BUILD_SYSTEM)/soong_cc_rust_prebuilt.mk", |
| 91 | EntryMap: make(map[string][]string), |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 92 | }, |
| 93 | } |
Colin Cross | ca860ac | 2016-01-04 14:34:37 -0800 | [diff] [blame] | 94 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 95 | entries := &providerData.PrimaryInfo |
| 96 | if len(c.Properties.Logtags) > 0 { |
| 97 | entries.AddStrings("LOCAL_SOONG_LOGTAGS_FILES", c.logtagsPaths.Strings()...) |
| 98 | } |
| 99 | // Note: Pass the exact value of AndroidMkSystemSharedLibs to the Make |
| 100 | // world, even if it is an empty list. In the Make world, |
| 101 | // LOCAL_SYSTEM_SHARED_LIBRARIES defaults to "none", which is expanded |
| 102 | // to the default list of system shared libs by the build system. |
| 103 | // Soong computes the exact list of system shared libs, so we have to |
| 104 | // override the default value when the list of libs is actually empty. |
| 105 | entries.SetString("LOCAL_SYSTEM_SHARED_LIBRARIES", strings.Join(c.Properties.AndroidMkSystemSharedLibs, " ")) |
| 106 | if len(c.Properties.AndroidMkSharedLibs) > 0 { |
| 107 | entries.AddStrings("LOCAL_SHARED_LIBRARIES", c.Properties.AndroidMkSharedLibs...) |
| 108 | } |
| 109 | if len(c.Properties.AndroidMkRuntimeLibs) > 0 { |
| 110 | entries.AddStrings("LOCAL_RUNTIME_LIBRARIES", c.Properties.AndroidMkRuntimeLibs...) |
| 111 | } |
| 112 | entries.SetString("LOCAL_SOONG_LINK_TYPE", c.makeLinkType) |
| 113 | if c.InVendor() { |
| 114 | entries.SetBool("LOCAL_IN_VENDOR", true) |
| 115 | } else if c.InProduct() { |
| 116 | entries.SetBool("LOCAL_IN_PRODUCT", true) |
| 117 | } |
| 118 | if c.Properties.SdkAndPlatformVariantVisibleToMake { |
| 119 | // Add the unsuffixed name to SOONG_SDK_VARIANT_MODULES so that Make can rewrite |
| 120 | // dependencies to the .sdk suffix when building a module that uses the SDK. |
| 121 | entries.SetString("SOONG_SDK_VARIANT_MODULES", |
| 122 | "$(SOONG_SDK_VARIANT_MODULES) $(patsubst %.sdk,%,$(LOCAL_MODULE))") |
| 123 | } |
| 124 | entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", c.IsSkipInstall()) |
| 125 | |
Colin Cross | ca860ac | 2016-01-04 14:34:37 -0800 | [diff] [blame] | 126 | for _, feature := range c.features { |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 127 | c.subAndroidMk(config, entries, feature) |
Colin Cross | ca860ac | 2016-01-04 14:34:37 -0800 | [diff] [blame] | 128 | } |
| 129 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 130 | c.subAndroidMk(config, entries, c.compiler) |
| 131 | c.subAndroidMk(config, entries, c.linker) |
Colin Cross | 8ff9ef4 | 2017-05-08 13:44:11 -0700 | [diff] [blame] | 132 | if c.sanitize != nil { |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 133 | c.subAndroidMk(config, entries, c.sanitize) |
Colin Cross | 8ff9ef4 | 2017-05-08 13:44:11 -0700 | [diff] [blame] | 134 | } |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 135 | c.subAndroidMk(config, entries, c.installer) |
Colin Cross | ca860ac | 2016-01-04 14:34:37 -0800 | [diff] [blame] | 136 | |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 137 | entries.SubName += c.Properties.SubName |
Dan Willemsen | 4416e5d | 2017-04-06 12:43:22 -0700 | [diff] [blame] | 138 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 139 | // The footer info comes at the last step, previously it was achieved by |
| 140 | // calling some extra footer function that were added earlier. Because we no |
| 141 | // longer use these extra footer functions, we need to put this step at the |
| 142 | // last one. |
| 143 | if c.Properties.IsSdkVariant && c.Properties.SdkAndPlatformVariantVisibleToMake && |
| 144 | c.CcLibraryInterface() && c.Shared() { |
| 145 | // Using the SDK variant as a JNI library needs a copy of the .so that |
| 146 | // is not named .sdk.so so that it can be packaged into the APK with |
| 147 | // the right name. |
| 148 | entries.FooterStrings = []string{ |
| 149 | fmt.Sprintf("%s %s %s", "$(eval $(call copy-one-file,", |
| 150 | "$(LOCAL_BUILT_MODULE),", |
| 151 | "$(patsubst %.sdk.so,%.so,$(LOCAL_BUILT_MODULE))))")} |
| 152 | } |
| 153 | |
| 154 | for _, obj := range []interface{}{c.compiler, c.linker, c.sanitize, c.installer} { |
| 155 | if obj == nil { |
| 156 | continue |
| 157 | } |
| 158 | if p, ok := obj.(subAndroidMkFooterInfoProducer); ok { |
| 159 | p.prepareAndroidMKFooterInfo(config, c, entries) |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | return &providerData |
Colin Cross | ca860ac | 2016-01-04 14:34:37 -0800 | [diff] [blame] | 164 | } |
| 165 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 166 | func androidMkWriteExtraTestConfigs(extraTestConfigs android.Paths, entries *android.AndroidMkInfo) { |
Dan Shi | 95d1942 | 2020-08-15 12:24:26 -0700 | [diff] [blame] | 167 | if len(extraTestConfigs) > 0 { |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 168 | entries.AddStrings("LOCAL_EXTRA_FULL_TEST_CONFIGS", extraTestConfigs.Strings()...) |
Dan Shi | 95d1942 | 2020-08-15 12:24:26 -0700 | [diff] [blame] | 169 | } |
| 170 | } |
| 171 | |
dimitry | db41747 | 2019-05-20 16:16:47 +0200 | [diff] [blame] | 172 | func makeOverrideModuleNames(ctx AndroidMkContext, overrides []string) []string { |
| 173 | if ctx.Target().NativeBridge == android.NativeBridgeEnabled { |
| 174 | var result []string |
| 175 | for _, override := range overrides { |
Matthew Maurer | a61e31f | 2021-05-27 11:09:11 -0700 | [diff] [blame] | 176 | result = append(result, override+NativeBridgeSuffix) |
dimitry | db41747 | 2019-05-20 16:16:47 +0200 | [diff] [blame] | 177 | } |
| 178 | return result |
| 179 | } |
| 180 | |
| 181 | return overrides |
| 182 | } |
| 183 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 184 | func (library *libraryDecorator) androidMkWriteExportedFlags(entries *android.AndroidMkInfo) { |
Liz Kammer | b6a55bf | 2021-04-12 15:42:51 -0400 | [diff] [blame] | 185 | var exportedFlags []string |
| 186 | var includeDirs android.Paths |
| 187 | var systemIncludeDirs android.Paths |
| 188 | var exportedDeps android.Paths |
| 189 | |
| 190 | if library.flagExporterInfo != nil { |
| 191 | exportedFlags = library.flagExporterInfo.Flags |
| 192 | includeDirs = library.flagExporterInfo.IncludeDirs |
| 193 | systemIncludeDirs = library.flagExporterInfo.SystemIncludeDirs |
| 194 | exportedDeps = library.flagExporterInfo.Deps |
| 195 | } else { |
| 196 | exportedFlags = library.flagExporter.flags |
| 197 | includeDirs = library.flagExporter.dirs |
| 198 | systemIncludeDirs = library.flagExporter.systemDirs |
| 199 | exportedDeps = library.flagExporter.deps |
| 200 | } |
| 201 | for _, dir := range includeDirs { |
Jiyong Park | 7495504 | 2019-10-22 20:19:51 +0900 | [diff] [blame] | 202 | exportedFlags = append(exportedFlags, "-I"+dir.String()) |
Inseob Kim | 6937844 | 2019-06-03 19:10:47 +0900 | [diff] [blame] | 203 | } |
Liz Kammer | b6a55bf | 2021-04-12 15:42:51 -0400 | [diff] [blame] | 204 | for _, dir := range systemIncludeDirs { |
Jiyong Park | 7495504 | 2019-10-22 20:19:51 +0900 | [diff] [blame] | 205 | exportedFlags = append(exportedFlags, "-isystem "+dir.String()) |
Inseob Kim | 6937844 | 2019-06-03 19:10:47 +0900 | [diff] [blame] | 206 | } |
Dan Willemsen | 5853940 | 2017-03-19 13:44:32 -0700 | [diff] [blame] | 207 | if len(exportedFlags) > 0 { |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 208 | entries.AddStrings("LOCAL_EXPORT_CFLAGS", exportedFlags...) |
Dan Willemsen | d578134 | 2017-02-15 16:15:21 -0800 | [diff] [blame] | 209 | } |
Inseob Kim | 6937844 | 2019-06-03 19:10:47 +0900 | [diff] [blame] | 210 | if len(exportedDeps) > 0 { |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 211 | entries.AddStrings("LOCAL_EXPORT_C_INCLUDE_DEPS", exportedDeps.Strings()...) |
Dan Willemsen | 5853940 | 2017-03-19 13:44:32 -0700 | [diff] [blame] | 212 | } |
| 213 | } |
Dan Willemsen | d578134 | 2017-02-15 16:15:21 -0800 | [diff] [blame] | 214 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 215 | func (library *libraryDecorator) androidMkEntriesWriteAdditionalDependenciesForSourceAbiDiff(entries *android.AndroidMkInfo) { |
Hsin-Yi Chen | a6ddb14 | 2022-10-27 14:55:42 +0800 | [diff] [blame] | 216 | if !library.static() { |
| 217 | entries.AddPaths("LOCAL_ADDITIONAL_DEPENDENCIES", library.sAbiDiff) |
| 218 | } |
Logan Chien | 41eabe6 | 2019-04-10 13:33:58 +0800 | [diff] [blame] | 219 | } |
| 220 | |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 221 | // TODO(ccross): remove this once apex/androidmk.go is converted to AndroidMkEntries |
| 222 | func (library *libraryDecorator) androidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Writer) { |
Hsin-Yi Chen | a6ddb14 | 2022-10-27 14:55:42 +0800 | [diff] [blame] | 223 | if !library.static() { |
| 224 | fmt.Fprintln(w, "LOCAL_ADDITIONAL_DEPENDENCIES +=", strings.Join(library.sAbiDiff.Strings(), " ")) |
| 225 | } |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 226 | } |
| 227 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 228 | func (library *libraryDecorator) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
Dan Willemsen | d578134 | 2017-02-15 16:15:21 -0800 | [diff] [blame] | 229 | if library.static() { |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 230 | entries.Class = "STATIC_LIBRARIES" |
Dan Willemsen | d578134 | 2017-02-15 16:15:21 -0800 | [diff] [blame] | 231 | } else if library.shared() { |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 232 | entries.Class = "SHARED_LIBRARIES" |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 233 | entries.SetString("LOCAL_SOONG_TOC", library.toc().String()) |
| 234 | if !library.buildStubs() && library.unstrippedOutputFile != nil { |
| 235 | entries.SetString("LOCAL_SOONG_UNSTRIPPED_BINARY", library.unstrippedOutputFile.String()) |
| 236 | } |
| 237 | if len(library.Properties.Overrides) > 0 { |
| 238 | entries.SetString("LOCAL_OVERRIDES_MODULES", strings.Join(makeOverrideModuleNames(ctx, library.Properties.Overrides), " ")) |
| 239 | } |
| 240 | if len(library.postInstallCmds) > 0 { |
| 241 | entries.SetString("LOCAL_POST_INSTALL_CMD", strings.Join(library.postInstallCmds, "&& ")) |
| 242 | } |
Dan Willemsen | d578134 | 2017-02-15 16:15:21 -0800 | [diff] [blame] | 243 | } else if library.header() { |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 244 | entries.Class = "HEADER_LIBRARIES" |
Dan Willemsen | d578134 | 2017-02-15 16:15:21 -0800 | [diff] [blame] | 245 | } |
| 246 | |
Jingwen Chen | 40fd90a | 2020-06-15 05:24:19 +0000 | [diff] [blame] | 247 | if library.distFile != nil { |
| 248 | entries.DistFiles = android.MakeDefaultDistFiles(library.distFile) |
| 249 | } |
| 250 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 251 | library.androidMkWriteExportedFlags(entries) |
| 252 | library.androidMkEntriesWriteAdditionalDependenciesForSourceAbiDiff(entries) |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 253 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 254 | if entries.OutputFile.Valid() { |
| 255 | _, _, ext := android.SplitFileExt(entries.OutputFile.Path().Base()) |
| 256 | entries.SetString("LOCAL_BUILT_MODULE_STEM", "$(LOCAL_MODULE)"+ext) |
| 257 | } |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 258 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 259 | if library.coverageOutputFile.Valid() { |
| 260 | entries.SetString("LOCAL_PREBUILT_COVERAGE_ARCHIVE", library.coverageOutputFile.String()) |
| 261 | } |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 262 | |
Jiyong Park | b078857 | 2018-12-20 22:10:17 +0900 | [diff] [blame] | 263 | if library.shared() && !library.buildStubs() { |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 264 | ctx.subAndroidMk(config, entries, library.baseInstaller) |
Colin Cross | b60190a | 2018-09-04 16:28:17 -0700 | [diff] [blame] | 265 | } else { |
Colin Cross | 127bb8b | 2020-12-16 16:46:01 -0800 | [diff] [blame] | 266 | if library.buildStubs() && library.stubsVersion() != "" { |
Jooyung Han | ad4c187 | 2020-02-27 17:56:44 +0900 | [diff] [blame] | 267 | entries.SubName = "." + library.stubsVersion() |
| 268 | } |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 269 | // library.makeUninstallable() depends on this to bypass HideFromMake() for |
| 270 | // static libraries. |
| 271 | entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true) |
| 272 | if library.buildStubs() { |
| 273 | entries.SetBool("LOCAL_NO_NOTICE_FILE", true) |
| 274 | } |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 275 | } |
Jiyong Park | f7c3bbe | 2020-12-09 21:18:56 +0900 | [diff] [blame] | 276 | // If a library providing a stub is included in an APEX, the private APIs of the library |
| 277 | // is accessible only inside the APEX. From outside of the APEX, clients can only use the |
| 278 | // public APIs via the stub. To enforce this, the (latest version of the) stub gets the |
| 279 | // name of the library. The impl library instead gets the `.bootstrap` suffix to so that |
| 280 | // they can be exceptionally used directly when APEXes are not available (e.g. during the |
| 281 | // very early stage in the boot process). |
| 282 | if len(library.Properties.Stubs.Versions) > 0 && !ctx.Host() && ctx.NotInPlatform() && |
Kiyoung Kim | aa39480 | 2024-01-08 12:55:45 +0900 | [diff] [blame] | 283 | !ctx.InRamdisk() && !ctx.InVendorRamdisk() && !ctx.InRecovery() && !ctx.InVendorOrProduct() && !ctx.static() { |
Jooyung Han | ad4c187 | 2020-02-27 17:56:44 +0900 | [diff] [blame] | 284 | if library.buildStubs() && library.isLatestStubVersion() { |
Jooyung Han | ad4c187 | 2020-02-27 17:56:44 +0900 | [diff] [blame] | 285 | entries.SubName = "" |
| 286 | } |
Jiyong Park | b078857 | 2018-12-20 22:10:17 +0900 | [diff] [blame] | 287 | if !library.buildStubs() { |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 288 | entries.SubName = ".bootstrap" |
Jiyong Park | b078857 | 2018-12-20 22:10:17 +0900 | [diff] [blame] | 289 | } |
| 290 | } |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 291 | } |
| 292 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 293 | func (object *objectLinker) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 294 | entries.Class = "STATIC_LIBRARIES" |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 295 | } |
| 296 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 297 | func (object *objectLinker) prepareAndroidMKFooterInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
| 298 | out := entries.OutputFile.Path() |
| 299 | name := ctx.BaseModuleName() |
| 300 | if entries.OverrideName != "" { |
| 301 | name = entries.OverrideName |
| 302 | } |
| 303 | |
| 304 | prefix := "" |
| 305 | if ctx.ArchSpecific() { |
| 306 | switch ctx.Os().Class { |
| 307 | case android.Host: |
| 308 | if ctx.Target().HostCross { |
| 309 | prefix = "HOST_CROSS_" |
| 310 | } else { |
| 311 | prefix = "HOST_" |
| 312 | } |
| 313 | case android.Device: |
| 314 | prefix = "TARGET_" |
| 315 | |
Trevor Radcliffe | f389cb4 | 2022-03-24 21:06:14 +0000 | [diff] [blame] | 316 | } |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 317 | |
| 318 | if ctx.Arch().ArchType != config.Targets[ctx.Os()][0].Arch.ArchType { |
| 319 | prefix = "2ND_" + prefix |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | varname := fmt.Sprintf("SOONG_%sOBJECT_%s%s", prefix, name, entries.SubName) |
| 324 | |
| 325 | entries.FooterStrings = append(entries.FooterStrings, |
| 326 | fmt.Sprintf("\n%s := %s\n.KATI_READONLY: %s", varname, out.String(), varname)) |
Trevor Radcliffe | f389cb4 | 2022-03-24 21:06:14 +0000 | [diff] [blame] | 327 | } |
| 328 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 329 | func (test *testDecorator) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
| 330 | if len(test.InstallerProperties.Test_suites) > 0 { |
| 331 | entries.AddCompatibilityTestSuites(test.InstallerProperties.Test_suites...) |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | func (binary *binaryDecorator) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
| 336 | ctx.subAndroidMk(config, entries, binary.baseInstaller) |
Dan Willemsen | 7517ed0 | 2016-06-10 17:20:30 -0700 | [diff] [blame] | 337 | |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 338 | entries.Class = "EXECUTABLES" |
Jingwen Chen | 40fd90a | 2020-06-15 05:24:19 +0000 | [diff] [blame] | 339 | entries.DistFiles = binary.distFiles |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 340 | entries.SetString("LOCAL_SOONG_UNSTRIPPED_BINARY", binary.unstrippedOutputFile.String()) |
| 341 | if len(binary.symlinks) > 0 { |
| 342 | entries.AddStrings("LOCAL_MODULE_SYMLINKS", binary.symlinks...) |
| 343 | } |
Colin Cross | 9b09f24 | 2016-12-07 13:37:42 -0800 | [diff] [blame] | 344 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 345 | if binary.coverageOutputFile.Valid() { |
| 346 | entries.SetString("LOCAL_PREBUILT_COVERAGE_ARCHIVE", binary.coverageOutputFile.String()) |
| 347 | } |
Yifan Hong | 946e32e | 2018-04-03 13:22:50 -0700 | [diff] [blame] | 348 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 349 | if len(binary.Properties.Overrides) > 0 { |
| 350 | entries.SetString("LOCAL_OVERRIDES_MODULES", strings.Join(makeOverrideModuleNames(ctx, binary.Properties.Overrides), " ")) |
| 351 | } |
| 352 | if len(binary.postInstallCmds) > 0 { |
| 353 | entries.SetString("LOCAL_POST_INSTALL_CMD", strings.Join(binary.postInstallCmds, "&& ")) |
| 354 | } |
Colin Cross | ca860ac | 2016-01-04 14:34:37 -0800 | [diff] [blame] | 355 | } |
| 356 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 357 | func (benchmark *benchmarkDecorator) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
| 358 | ctx.subAndroidMk(config, entries, benchmark.binaryDecorator) |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 359 | entries.Class = "NATIVE_TESTS" |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 360 | if len(benchmark.Properties.Test_suites) > 0 { |
| 361 | entries.AddCompatibilityTestSuites(benchmark.Properties.Test_suites...) |
| 362 | } |
| 363 | if benchmark.testConfig != nil { |
| 364 | entries.SetString("LOCAL_FULL_TEST_CONFIG", benchmark.testConfig.String()) |
| 365 | } |
| 366 | entries.SetBool("LOCAL_NATIVE_BENCHMARK", true) |
| 367 | if !BoolDefault(benchmark.Properties.Auto_gen_config, true) { |
| 368 | entries.SetBool("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", true) |
| 369 | } |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 370 | } |
| 371 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 372 | func (test *testBinary) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
| 373 | ctx.subAndroidMk(config, entries, test.binaryDecorator) |
| 374 | ctx.subAndroidMk(config, entries, test.testDecorator) |
Trevor Radcliffe | f389cb4 | 2022-03-24 21:06:14 +0000 | [diff] [blame] | 375 | |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 376 | entries.Class = "NATIVE_TESTS" |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 377 | if test.testConfig != nil { |
| 378 | entries.SetString("LOCAL_FULL_TEST_CONFIG", test.testConfig.String()) |
| 379 | } |
| 380 | if !BoolDefault(test.Properties.Auto_gen_config, true) { |
| 381 | entries.SetBool("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", true) |
| 382 | } |
| 383 | entries.AddStrings("LOCAL_TEST_MAINLINE_MODULES", test.Properties.Test_mainline_modules...) |
Colin Cross | cfb0f5e | 2021-09-24 15:47:17 -0700 | [diff] [blame] | 384 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 385 | entries.SetBoolIfTrue("LOCAL_COMPATIBILITY_PER_TESTCASE_DIRECTORY", Bool(test.Properties.Per_testcase_directory)) |
| 386 | if len(test.Properties.Data_bins) > 0 { |
| 387 | entries.AddStrings("LOCAL_TEST_DATA_BINS", test.Properties.Data_bins...) |
| 388 | } |
Zhenhuang Wang | 0ac5a43 | 2022-08-12 18:49:20 +0800 | [diff] [blame] | 389 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 390 | test.Properties.Test_options.CommonTestOptions.SetAndroidMkInfoEntries(entries) |
Colin Cross | a929db0 | 2017-03-27 16:27:50 -0700 | [diff] [blame] | 391 | |
Dan Shi | 95d1942 | 2020-08-15 12:24:26 -0700 | [diff] [blame] | 392 | androidMkWriteExtraTestConfigs(test.extraTestConfigs, entries) |
Colin Cross | a234466 | 2016-03-24 13:14:12 -0700 | [diff] [blame] | 393 | } |
| 394 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 395 | func (fuzz *fuzzBinary) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
| 396 | ctx.subAndroidMk(config, entries, fuzz.binaryDecorator) |
Mitch Phillips | 4e4ab8a | 2019-09-13 17:32:50 -0700 | [diff] [blame] | 397 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 398 | entries.SetBool("LOCAL_IS_FUZZ_TARGET", true) |
| 399 | if fuzz.installedSharedDeps != nil { |
| 400 | // TOOD: move to install dep |
| 401 | entries.AddStrings("LOCAL_FUZZ_INSTALLED_SHARED_DEPS", fuzz.installedSharedDeps...) |
| 402 | } |
Mitch Phillips | 4e4ab8a | 2019-09-13 17:32:50 -0700 | [diff] [blame] | 403 | } |
| 404 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 405 | func (test *testLibrary) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
| 406 | ctx.subAndroidMk(config, entries, test.libraryDecorator) |
| 407 | ctx.subAndroidMk(config, entries, test.testDecorator) |
Colin Cross | b916a38 | 2016-07-29 17:28:03 -0700 | [diff] [blame] | 408 | } |
Dan Willemsen | e7932e8 | 2016-05-16 15:56:53 -0700 | [diff] [blame] | 409 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 410 | func (installer *baseInstaller) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
Colin Cross | c511bc5 | 2020-04-07 16:50:32 +0000 | [diff] [blame] | 411 | if installer.path == (android.InstallPath{}) { |
| 412 | return |
| 413 | } |
Dan Willemsen | 03ce63e | 2016-09-29 12:17:49 -0700 | [diff] [blame] | 414 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 415 | path, file := filepath.Split(installer.path.String()) |
| 416 | stem, suffix, _ := android.SplitFileExt(file) |
| 417 | entries.SetString("LOCAL_MODULE_SUFFIX", suffix) |
| 418 | entries.SetString("LOCAL_MODULE_PATH", path) |
| 419 | entries.SetString("LOCAL_MODULE_STEM", stem) |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 420 | } |
Dan Albert | 914449f | 2016-06-17 16:45:24 -0700 | [diff] [blame] | 421 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 422 | func (c *stubDecorator) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
Dan Albert | 1a24627 | 2020-07-06 14:49:35 -0700 | [diff] [blame] | 423 | entries.SubName = ndkLibrarySuffix + "." + c.apiLevel.String() |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 424 | entries.Class = "SHARED_LIBRARIES" |
Dan Albert | 914449f | 2016-06-17 16:45:24 -0700 | [diff] [blame] | 425 | |
Colin Cross | 5ec407b | 2020-09-30 11:41:33 -0700 | [diff] [blame] | 426 | if !c.buildStubs() { |
| 427 | entries.Disabled = true |
| 428 | return |
| 429 | } |
| 430 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 431 | path, file := filepath.Split(c.installPath.String()) |
| 432 | stem, suffix, _ := android.SplitFileExt(file) |
| 433 | entries.SetString("LOCAL_MODULE_SUFFIX", suffix) |
| 434 | entries.SetString("LOCAL_MODULE_PATH", path) |
| 435 | entries.SetString("LOCAL_MODULE_STEM", stem) |
| 436 | entries.SetBool("LOCAL_NO_NOTICE_FILE", true) |
| 437 | if c.parsedCoverageXmlPath.String() != "" { |
| 438 | entries.SetString("SOONG_NDK_API_XML", "$(SOONG_NDK_API_XML) "+c.parsedCoverageXmlPath.String()) |
| 439 | } |
| 440 | entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true) // Stubs should not be installed |
Dan Albert | 914449f | 2016-06-17 16:45:24 -0700 | [diff] [blame] | 441 | } |
Dan Willemsen | b916b80 | 2017-03-19 13:44:32 -0700 | [diff] [blame] | 442 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 443 | func (c *vndkPrebuiltLibraryDecorator) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 444 | entries.Class = "SHARED_LIBRARIES" |
Justin Yun | 7154928 | 2017-11-17 12:10:28 +0900 | [diff] [blame] | 445 | |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 446 | entries.SubName = c.androidMkSuffix |
Justin Yun | 7154928 | 2017-11-17 12:10:28 +0900 | [diff] [blame] | 447 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 448 | c.libraryDecorator.androidMkWriteExportedFlags(entries) |
Justin Yun | 7154928 | 2017-11-17 12:10:28 +0900 | [diff] [blame] | 449 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 450 | // Specifying stem is to pass check_elf_files when vendor modules link against vndk prebuilt. |
| 451 | // We can't use install path because VNDKs are not installed. Instead, Srcs is directly used. |
| 452 | _, file := filepath.Split(c.properties.Srcs[0]) |
| 453 | stem, suffix, ext := android.SplitFileExt(file) |
| 454 | entries.SetString("LOCAL_BUILT_MODULE_STEM", "$(LOCAL_MODULE)"+ext) |
| 455 | entries.SetString("LOCAL_MODULE_SUFFIX", suffix) |
| 456 | entries.SetString("LOCAL_MODULE_STEM", stem) |
Inseob Kim | 81235ff | 2020-10-23 14:36:11 +0900 | [diff] [blame] | 457 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 458 | if c.tocFile.Valid() { |
| 459 | entries.SetString("LOCAL_SOONG_TOC", c.tocFile.String()) |
| 460 | } |
Inseob Kim | 81235ff | 2020-10-23 14:36:11 +0900 | [diff] [blame] | 461 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 462 | // VNDK libraries available to vendor are not installed because |
| 463 | // they are packaged in VNDK APEX and installed by APEX packages (apex/apex.go) |
| 464 | entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true) |
Inseob Kim | eec88e1 | 2020-01-22 11:11:29 +0900 | [diff] [blame] | 465 | } |
| 466 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 467 | func (p *prebuiltLinker) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
| 468 | if p.properties.Check_elf_files != nil { |
| 469 | entries.SetBool("LOCAL_CHECK_ELF_FILES", *p.properties.Check_elf_files) |
| 470 | } else { |
| 471 | // soong_cc_rust_prebuilt.mk does not include check_elf_file.mk by default |
| 472 | // because cc_library_shared and cc_binary use soong_cc_rust_prebuilt.mk as well. |
| 473 | // In order to turn on prebuilt ABI checker, set `LOCAL_CHECK_ELF_FILES` to |
| 474 | // true if `p.properties.Check_elf_files` is not specified. |
| 475 | entries.SetBool("LOCAL_CHECK_ELF_FILES", true) |
| 476 | } |
Logan Chien | 4fcea3d | 2018-11-20 11:59:08 +0800 | [diff] [blame] | 477 | } |
| 478 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 479 | func (p *prebuiltLibraryLinker) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
| 480 | ctx.subAndroidMk(config, entries, p.libraryDecorator) |
Logan Chien | 4fcea3d | 2018-11-20 11:59:08 +0800 | [diff] [blame] | 481 | if p.shared() { |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 482 | ctx.subAndroidMk(config, entries, &p.prebuiltLinker) |
Steven Moreland | dabe2d4 | 2024-06-04 01:22:40 +0000 | [diff] [blame] | 483 | androidMkWritePrebuiltOptions(p.baseLinker, entries) |
Logan Chien | 4fcea3d | 2018-11-20 11:59:08 +0800 | [diff] [blame] | 484 | } |
| 485 | } |
| 486 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 487 | func (p *prebuiltBinaryLinker) prepareAndroidMKProviderInfo(config android.Config, ctx AndroidMkContext, entries *android.AndroidMkInfo) { |
| 488 | ctx.subAndroidMk(config, entries, p.binaryDecorator) |
| 489 | ctx.subAndroidMk(config, entries, &p.prebuiltLinker) |
Steven Moreland | dabe2d4 | 2024-06-04 01:22:40 +0000 | [diff] [blame] | 490 | androidMkWritePrebuiltOptions(p.baseLinker, entries) |
Logan Chien | 4fcea3d | 2018-11-20 11:59:08 +0800 | [diff] [blame] | 491 | } |
| 492 | |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 493 | func androidMkWritePrebuiltOptions(linker *baseLinker, entries *android.AndroidMkInfo) { |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 494 | allow := linker.Properties.Allow_undefined_symbols |
| 495 | if allow != nil { |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 496 | entries.SetBool("LOCAL_ALLOW_UNDEFINED_SYMBOLS", *allow) |
Colin Cross | d80cbca | 2020-02-24 12:01:37 -0800 | [diff] [blame] | 497 | } |
Steven Moreland | dabe2d4 | 2024-06-04 01:22:40 +0000 | [diff] [blame] | 498 | ignore := linker.Properties.Ignore_max_page_size |
| 499 | if ignore != nil { |
Yu Liu | e70976d | 2024-10-15 20:45:35 +0000 | [diff] [blame] | 500 | entries.SetBool("LOCAL_IGNORE_MAX_PAGE_SIZE", *ignore) |
Steven Moreland | dabe2d4 | 2024-06-04 01:22:40 +0000 | [diff] [blame] | 501 | } |
Logan Chien | 4fcea3d | 2018-11-20 11:59:08 +0800 | [diff] [blame] | 502 | } |