Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 1 | // Copyright 2019 The Android Open Source Project |
| 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 rust |
| 16 | |
| 17 | import ( |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 18 | "path/filepath" |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 19 | |
| 20 | "android/soong/android" |
Ivan Lozano | 9da4aa8 | 2021-01-29 12:48:05 -0500 | [diff] [blame] | 21 | "android/soong/cc" |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 22 | ) |
| 23 | |
| 24 | type AndroidMkContext interface { |
| 25 | Name() string |
| 26 | Target() android.Target |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 27 | SubAndroidMk(*android.AndroidMkEntries, interface{}) |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 28 | } |
| 29 | |
Andrei Homescu | c776792 | 2020-08-05 06:36:19 -0700 | [diff] [blame] | 30 | type SubAndroidMkProvider interface { |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 31 | AndroidMk(AndroidMkContext, *android.AndroidMkEntries) |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 32 | } |
| 33 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 34 | func (mod *Module) SubAndroidMk(data *android.AndroidMkEntries, obj interface{}) { |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 35 | if mod.subAndroidMkOnce == nil { |
Andrei Homescu | c776792 | 2020-08-05 06:36:19 -0700 | [diff] [blame] | 36 | mod.subAndroidMkOnce = make(map[SubAndroidMkProvider]bool) |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 37 | } |
Andrei Homescu | c776792 | 2020-08-05 06:36:19 -0700 | [diff] [blame] | 38 | if androidmk, ok := obj.(SubAndroidMkProvider); ok { |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 39 | if !mod.subAndroidMkOnce[androidmk] { |
| 40 | mod.subAndroidMkOnce[androidmk] = true |
| 41 | androidmk.AndroidMk(mod, data) |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 46 | func (mod *Module) AndroidMkEntries() []android.AndroidMkEntries { |
Jiyong Park | 99644e9 | 2020-11-17 22:21:02 +0900 | [diff] [blame] | 47 | if mod.Properties.HideFromMake || mod.hideApexVariantFromMake { |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 48 | |
| 49 | return []android.AndroidMkEntries{android.AndroidMkEntries{Disabled: true}} |
Ivan Lozano | a0cd8f9 | 2020-04-09 09:56:02 -0400 | [diff] [blame] | 50 | } |
| 51 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 52 | ret := android.AndroidMkEntries{ |
Ivan Lozano | 8d10fc3 | 2021-11-05 16:36:47 -0400 | [diff] [blame] | 53 | OutputFile: android.OptionalPathForPath(mod.UnstrippedOutputFile()), |
Ivan Lozano | d06cc74 | 2021-11-12 13:27:58 -0500 | [diff] [blame] | 54 | Include: "$(BUILD_SYSTEM)/soong_cc_rust_prebuilt.mk", |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 55 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
Colin Cross | aa25553 | 2020-07-03 13:18:24 -0700 | [diff] [blame] | 56 | func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 57 | entries.AddStrings("LOCAL_RLIB_LIBRARIES", mod.Properties.AndroidMkRlibs...) |
| 58 | entries.AddStrings("LOCAL_DYLIB_LIBRARIES", mod.Properties.AndroidMkDylibs...) |
| 59 | entries.AddStrings("LOCAL_PROC_MACRO_LIBRARIES", mod.Properties.AndroidMkProcMacroLibs...) |
| 60 | entries.AddStrings("LOCAL_SHARED_LIBRARIES", mod.Properties.AndroidMkSharedLibs...) |
| 61 | entries.AddStrings("LOCAL_STATIC_LIBRARIES", mod.Properties.AndroidMkStaticLibs...) |
Ivan Lozano | 6a88443 | 2020-12-02 09:15:16 -0500 | [diff] [blame] | 62 | entries.AddStrings("LOCAL_SOONG_LINK_TYPE", mod.makeLinkType) |
Ivan Lozano | c08897c | 2021-04-02 12:41:32 -0400 | [diff] [blame] | 63 | if mod.UseVndk() { |
| 64 | entries.SetBool("LOCAL_USE_VNDK", true) |
| 65 | } |
| 66 | |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 67 | }, |
| 68 | }, |
| 69 | } |
Ivan Lozano | 26ecd6c | 2020-07-31 13:40:31 -0400 | [diff] [blame] | 70 | |
| 71 | if mod.compiler != nil && !mod.compiler.Disabled() { |
Andrei Homescu | c776792 | 2020-08-05 06:36:19 -0700 | [diff] [blame] | 72 | mod.SubAndroidMk(&ret, mod.compiler) |
Ivan Lozano | 4fef93c | 2020-07-08 08:39:44 -0400 | [diff] [blame] | 73 | } else if mod.sourceProvider != nil { |
Ivan Lozano | 26ecd6c | 2020-07-31 13:40:31 -0400 | [diff] [blame] | 74 | // If the compiler is disabled, this is a SourceProvider. |
Andrei Homescu | c776792 | 2020-08-05 06:36:19 -0700 | [diff] [blame] | 75 | mod.SubAndroidMk(&ret, mod.sourceProvider) |
Ivan Lozano | 4fef93c | 2020-07-08 08:39:44 -0400 | [diff] [blame] | 76 | } |
Tri Vo | 0a74c3e | 2021-04-01 13:59:27 -0700 | [diff] [blame] | 77 | |
| 78 | if mod.sanitize != nil { |
| 79 | mod.SubAndroidMk(&ret, mod.sanitize) |
| 80 | } |
| 81 | |
Ivan Lozano | c08897c | 2021-04-02 12:41:32 -0400 | [diff] [blame] | 82 | ret.SubName += mod.Properties.RustSubName |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 83 | ret.SubName += mod.Properties.SubName |
| 84 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 85 | return []android.AndroidMkEntries{ret} |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 86 | } |
| 87 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 88 | func (binary *binaryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) { |
Andrei Homescu | c776792 | 2020-08-05 06:36:19 -0700 | [diff] [blame] | 89 | ctx.SubAndroidMk(ret, binary.baseCompiler) |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 90 | |
Jingwen Chen | 40fd90a | 2020-06-15 05:24:19 +0000 | [diff] [blame] | 91 | if binary.distFile.Valid() { |
| 92 | ret.DistFiles = android.MakeDefaultDistFiles(binary.distFile.Path()) |
| 93 | } |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 94 | ret.Class = "EXECUTABLES" |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 95 | } |
| 96 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 97 | func (test *testDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) { |
Ivan Lozano | 9da4aa8 | 2021-01-29 12:48:05 -0500 | [diff] [blame] | 98 | ctx.SubAndroidMk(ret, test.binaryDecorator) |
| 99 | |
Chih-Hung Hsieh | 15f369e | 2019-11-15 04:14:44 -0800 | [diff] [blame] | 100 | ret.Class = "NATIVE_TESTS" |
Colin Cross | aa25553 | 2020-07-03 13:18:24 -0700 | [diff] [blame] | 101 | ret.ExtraEntries = append(ret.ExtraEntries, |
| 102 | func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { |
| 103 | entries.AddCompatibilityTestSuites(test.Properties.Test_suites...) |
| 104 | if test.testConfig != nil { |
| 105 | entries.SetString("LOCAL_FULL_TEST_CONFIG", test.testConfig.String()) |
| 106 | } |
| 107 | entries.SetBoolIfTrue("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", !BoolDefault(test.Properties.Auto_gen_config, true)) |
| 108 | entries.SetBoolIfTrue("LOCAL_IS_UNIT_TEST", Bool(test.Properties.Test_options.Unit_test)) |
yangbill | 22bafec | 2022-02-11 18:06:07 +0800 | [diff] [blame] | 109 | if test.Properties.Data_bins != nil { |
| 110 | entries.AddStrings("LOCAL_TEST_DATA_BINS", test.Properties.Data_bins...) |
| 111 | } |
Colin Cross | aa25553 | 2020-07-03 13:18:24 -0700 | [diff] [blame] | 112 | }) |
Ivan Lozano | 9da4aa8 | 2021-01-29 12:48:05 -0500 | [diff] [blame] | 113 | |
| 114 | cc.AndroidMkWriteTestData(test.data, ret) |
Chih-Hung Hsieh | a5f22ed | 2019-10-24 20:47:54 -0700 | [diff] [blame] | 115 | } |
| 116 | |
Jakub Kotur | 546ccd5 | 2021-01-15 15:57:27 +0100 | [diff] [blame] | 117 | func (benchmark *benchmarkDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) { |
| 118 | benchmark.binaryDecorator.AndroidMk(ctx, ret) |
| 119 | ret.Class = "NATIVE_TESTS" |
| 120 | ret.ExtraEntries = append(ret.ExtraEntries, |
| 121 | func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { |
| 122 | entries.AddCompatibilityTestSuites(benchmark.Properties.Test_suites...) |
| 123 | if benchmark.testConfig != nil { |
| 124 | entries.SetString("LOCAL_FULL_TEST_CONFIG", benchmark.testConfig.String()) |
| 125 | } |
| 126 | entries.SetBool("LOCAL_NATIVE_BENCHMARK", true) |
| 127 | entries.SetBoolIfTrue("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", !BoolDefault(benchmark.Properties.Auto_gen_config, true)) |
| 128 | }) |
| 129 | } |
| 130 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 131 | func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) { |
Andrei Homescu | c776792 | 2020-08-05 06:36:19 -0700 | [diff] [blame] | 132 | ctx.SubAndroidMk(ret, library.baseCompiler) |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 133 | |
| 134 | if library.rlib() { |
| 135 | ret.Class = "RLIB_LIBRARIES" |
| 136 | } else if library.dylib() { |
| 137 | ret.Class = "DYLIB_LIBRARIES" |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 138 | } else if library.static() { |
| 139 | ret.Class = "STATIC_LIBRARIES" |
| 140 | } else if library.shared() { |
| 141 | ret.Class = "SHARED_LIBRARIES" |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 142 | } |
Jingwen Chen | 40fd90a | 2020-06-15 05:24:19 +0000 | [diff] [blame] | 143 | if library.distFile.Valid() { |
| 144 | ret.DistFiles = android.MakeDefaultDistFiles(library.distFile.Path()) |
| 145 | } |
Ivan Lozano | 7b0781d | 2021-11-03 15:30:18 -0400 | [diff] [blame] | 146 | ret.ExtraEntries = append(ret.ExtraEntries, |
| 147 | func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { |
| 148 | if library.tocFile.Valid() { |
| 149 | entries.SetString("LOCAL_SOONG_TOC", library.tocFile.String()) |
| 150 | } |
| 151 | }) |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 152 | } |
Ivan Lozano | fba2aa2 | 2021-11-11 09:29:07 -0500 | [diff] [blame] | 153 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 154 | func (procMacro *procMacroDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) { |
Andrei Homescu | c776792 | 2020-08-05 06:36:19 -0700 | [diff] [blame] | 155 | ctx.SubAndroidMk(ret, procMacro.baseCompiler) |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 156 | |
| 157 | ret.Class = "PROC_MACRO_LIBRARIES" |
Jingwen Chen | 40fd90a | 2020-06-15 05:24:19 +0000 | [diff] [blame] | 158 | if procMacro.distFile.Valid() { |
| 159 | ret.DistFiles = android.MakeDefaultDistFiles(procMacro.distFile.Path()) |
| 160 | } |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 161 | |
| 162 | } |
| 163 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 164 | func (sourceProvider *BaseSourceProvider) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) { |
Chih-Hung Hsieh | c49649c | 2020-10-01 21:25:05 -0700 | [diff] [blame] | 165 | outFile := sourceProvider.OutputFiles[0] |
Ivan Lozano | 4fef93c | 2020-07-08 08:39:44 -0400 | [diff] [blame] | 166 | ret.Class = "ETC" |
| 167 | ret.OutputFile = android.OptionalPathForPath(outFile) |
Ivan Lozano | 26ecd6c | 2020-07-31 13:40:31 -0400 | [diff] [blame] | 168 | ret.SubName += sourceProvider.subName |
Colin Cross | aa25553 | 2020-07-03 13:18:24 -0700 | [diff] [blame] | 169 | ret.ExtraEntries = append(ret.ExtraEntries, |
| 170 | func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { |
| 171 | _, file := filepath.Split(outFile.String()) |
| 172 | stem, suffix, _ := android.SplitFileExt(file) |
| 173 | entries.SetString("LOCAL_MODULE_SUFFIX", suffix) |
| 174 | entries.SetString("LOCAL_MODULE_STEM", stem) |
| 175 | entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true) |
| 176 | }) |
Ivan Lozano | 4fef93c | 2020-07-08 08:39:44 -0400 | [diff] [blame] | 177 | } |
| 178 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 179 | func (bindgen *bindgenDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) { |
Andrei Homescu | c776792 | 2020-08-05 06:36:19 -0700 | [diff] [blame] | 180 | ctx.SubAndroidMk(ret, bindgen.BaseSourceProvider) |
Treehugger Robot | 588aae7 | 2020-08-21 10:01:58 +0000 | [diff] [blame] | 181 | } |
| 182 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 183 | func (proto *protobufDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) { |
Treehugger Robot | 588aae7 | 2020-08-21 10:01:58 +0000 | [diff] [blame] | 184 | ctx.SubAndroidMk(ret, proto.BaseSourceProvider) |
Ivan Lozano | 4fef93c | 2020-07-08 08:39:44 -0400 | [diff] [blame] | 185 | } |
| 186 | |
Liz Kammer | 4018a8d | 2020-11-24 09:35:21 -0800 | [diff] [blame] | 187 | func (compiler *baseCompiler) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) { |
Ivan Lozano | 2b08113 | 2020-09-08 12:46:52 -0400 | [diff] [blame] | 188 | if compiler.path == (android.InstallPath{}) { |
| 189 | return |
| 190 | } |
| 191 | |
Colin Cross | 7743557 | 2021-11-08 12:37:01 -0800 | [diff] [blame] | 192 | if compiler.strippedOutputFile.Valid() { |
ThiƩbaud Weksteen | fabaff6 | 2020-08-27 13:48:36 +0200 | [diff] [blame] | 193 | ret.OutputFile = compiler.strippedOutputFile |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 194 | } |
Ivan Lozano | 8d10fc3 | 2021-11-05 16:36:47 -0400 | [diff] [blame] | 195 | |
Colin Cross | aa25553 | 2020-07-03 13:18:24 -0700 | [diff] [blame] | 196 | ret.ExtraEntries = append(ret.ExtraEntries, |
| 197 | func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { |
Ivan Lozano | 8d10fc3 | 2021-11-05 16:36:47 -0400 | [diff] [blame] | 198 | entries.SetPath("LOCAL_SOONG_UNSTRIPPED_BINARY", compiler.unstrippedOutputFile) |
Colin Cross | c68db4b | 2021-11-11 18:59:15 -0800 | [diff] [blame] | 199 | path, file := filepath.Split(compiler.path.String()) |
Colin Cross | aa25553 | 2020-07-03 13:18:24 -0700 | [diff] [blame] | 200 | stem, suffix, _ := android.SplitFileExt(file) |
| 201 | entries.SetString("LOCAL_MODULE_SUFFIX", suffix) |
| 202 | entries.SetString("LOCAL_MODULE_PATH", path) |
| 203 | entries.SetString("LOCAL_MODULE_STEM", stem) |
| 204 | }) |
Ivan Lozano | ffee334 | 2019-08-27 12:03:00 -0700 | [diff] [blame] | 205 | } |
hamzeh | c651b52 | 2021-04-29 12:50:47 -0700 | [diff] [blame] | 206 | |
| 207 | func (fuzz *fuzzDecorator) AndroidMkEntries(ctx AndroidMkContext, entries *android.AndroidMkEntries) { |
| 208 | ctx.SubAndroidMk(entries, fuzz.binaryDecorator) |
| 209 | |
| 210 | var fuzzFiles []string |
hamzeh | 41ad881 | 2021-07-07 14:00:07 -0700 | [diff] [blame] | 211 | for _, d := range fuzz.fuzzPackagedModule.Corpus { |
hamzeh | c651b52 | 2021-04-29 12:50:47 -0700 | [diff] [blame] | 212 | fuzzFiles = append(fuzzFiles, |
hamzeh | 41ad881 | 2021-07-07 14:00:07 -0700 | [diff] [blame] | 213 | filepath.Dir(fuzz.fuzzPackagedModule.CorpusIntermediateDir.String())+":corpus/"+d.Base()) |
hamzeh | c651b52 | 2021-04-29 12:50:47 -0700 | [diff] [blame] | 214 | } |
| 215 | |
hamzeh | 41ad881 | 2021-07-07 14:00:07 -0700 | [diff] [blame] | 216 | for _, d := range fuzz.fuzzPackagedModule.Data { |
hamzeh | c651b52 | 2021-04-29 12:50:47 -0700 | [diff] [blame] | 217 | fuzzFiles = append(fuzzFiles, |
hamzeh | 41ad881 | 2021-07-07 14:00:07 -0700 | [diff] [blame] | 218 | filepath.Dir(fuzz.fuzzPackagedModule.DataIntermediateDir.String())+":data/"+d.Rel()) |
hamzeh | c651b52 | 2021-04-29 12:50:47 -0700 | [diff] [blame] | 219 | } |
| 220 | |
hamzeh | 41ad881 | 2021-07-07 14:00:07 -0700 | [diff] [blame] | 221 | if fuzz.fuzzPackagedModule.Dictionary != nil { |
hamzeh | c651b52 | 2021-04-29 12:50:47 -0700 | [diff] [blame] | 222 | fuzzFiles = append(fuzzFiles, |
hamzeh | 41ad881 | 2021-07-07 14:00:07 -0700 | [diff] [blame] | 223 | filepath.Dir(fuzz.fuzzPackagedModule.Dictionary.String())+":"+fuzz.fuzzPackagedModule.Dictionary.Base()) |
hamzeh | c651b52 | 2021-04-29 12:50:47 -0700 | [diff] [blame] | 224 | } |
| 225 | |
hamzeh | 41ad881 | 2021-07-07 14:00:07 -0700 | [diff] [blame] | 226 | if fuzz.fuzzPackagedModule.Config != nil { |
hamzeh | c651b52 | 2021-04-29 12:50:47 -0700 | [diff] [blame] | 227 | fuzzFiles = append(fuzzFiles, |
hamzeh | 41ad881 | 2021-07-07 14:00:07 -0700 | [diff] [blame] | 228 | filepath.Dir(fuzz.fuzzPackagedModule.Config.String())+":config.json") |
hamzeh | c651b52 | 2021-04-29 12:50:47 -0700 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, |
| 232 | entries *android.AndroidMkEntries) { |
| 233 | entries.SetBool("LOCAL_IS_FUZZ_TARGET", true) |
| 234 | if len(fuzzFiles) > 0 { |
| 235 | entries.AddStrings("LOCAL_TEST_DATA", fuzzFiles...) |
| 236 | } |
| 237 | }) |
| 238 | } |