blob: c1df0e941ba3cb197ce1b4ac2c0bde01834ebd37 [file] [log] [blame]
Hao Chen1c8ea5b2023-10-20 23:03:45 +00001// Copyright 2024 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 (
Hao Chen1c8ea5b2023-10-20 23:03:45 +000018 "bytes"
19 _ "embed"
20 "fmt"
21 "path/filepath"
22 "slices"
23 "sort"
24 "strings"
25 "text/template"
26
mrziwangf95cfa62024-06-18 10:11:39 -070027 "android/soong/android"
28
Hao Chen1c8ea5b2023-10-20 23:03:45 +000029 "github.com/google/blueprint"
30 "github.com/google/blueprint/proptools"
31)
32
33const veryVerbose bool = false
34
35//go:embed cmake_main.txt
36var templateCmakeMainRaw string
37var templateCmakeMain *template.Template = parseTemplate(templateCmakeMainRaw)
38
39//go:embed cmake_module_cc.txt
40var templateCmakeModuleCcRaw string
41var templateCmakeModuleCc *template.Template = parseTemplate(templateCmakeModuleCcRaw)
42
43//go:embed cmake_module_aidl.txt
44var templateCmakeModuleAidlRaw string
45var templateCmakeModuleAidl *template.Template = parseTemplate(templateCmakeModuleAidlRaw)
46
47//go:embed cmake_ext_add_aidl_library.txt
48var cmakeExtAddAidlLibrary string
49
50//go:embed cmake_ext_append_flags.txt
51var cmakeExtAppendFlags string
52
53var defaultUnportableFlags []string = []string{
Tomasz Wasilczykcd674732024-06-25 10:30:30 -070054 "-Wno-c99-designator",
Hao Chen1c8ea5b2023-10-20 23:03:45 +000055 "-Wno-class-memaccess",
56 "-Wno-exit-time-destructors",
Tomasz Wasilczykcd674732024-06-25 10:30:30 -070057 "-Winconsistent-missing-override",
Hao Chen1c8ea5b2023-10-20 23:03:45 +000058 "-Wno-inconsistent-missing-override",
59 "-Wreorder-init-list",
60 "-Wno-reorder-init-list",
61 "-Wno-restrict",
62 "-Wno-stringop-overread",
63 "-Wno-subobject-linkage",
64}
65
66var ignoredSystemLibs []string = []string{
Tomasz Wasilczyk2493fcc2024-06-20 15:29:09 -070067 "crtbegin_dynamic",
68 "crtend_android",
69 "libc",
Hao Chen1c8ea5b2023-10-20 23:03:45 +000070 "libc++",
71 "libc++_static",
Tomasz Wasilczyk7cec7e62024-07-01 11:31:47 -070072 "libc_musl",
73 "libc_musl_crtbegin_so",
74 "libc_musl_crtbegin_static",
75 "libc_musl_crtend",
76 "libc_musl_crtend_so",
Tomasz Wasilczyk2493fcc2024-06-20 15:29:09 -070077 "libdl",
78 "libm",
Hao Chen1c8ea5b2023-10-20 23:03:45 +000079 "prebuilt_libclang_rt.builtins",
80 "prebuilt_libclang_rt.ubsan_minimal",
81}
82
83// Mapping entry between Android's library name and the one used when building outside Android tree.
84type LibraryMappingProperty struct {
85 // Android library name.
86 Android_name string
87
88 // Library name used when building outside Android.
89 Mapped_name string
90
91 // If the make file is already present in Android source tree, specify its location.
92 Package_pregenerated string
93
94 // If the package is expected to be installed on the build host OS, specify its name.
95 Package_system string
96}
97
98type CmakeSnapshotProperties struct {
99 // Modules to add to the snapshot package. Their dependencies are pulled in automatically.
100 Modules []string
101
102 // Host prebuilts to bundle with the snapshot. These are tools needed to build outside Android.
103 Prebuilts []string
104
105 // Global cflags to add when building outside Android.
106 Cflags []string
107
108 // Flags to skip when building outside Android.
109 Cflags_ignored []string
110
111 // Mapping between library names used in Android tree and externally.
112 Library_mapping []LibraryMappingProperty
113
114 // List of cflags that are not portable between compilers that could potentially be used to
115 // build a generated package. If left empty, it's initialized with a default list.
116 Unportable_flags []string
117
118 // Whether to include source code as part of the snapshot package.
119 Include_sources bool
120}
121
122var cmakeSnapshotSourcesProvider = blueprint.NewProvider[android.Paths]()
123
124type CmakeSnapshot struct {
125 android.ModuleBase
126
127 Properties CmakeSnapshotProperties
128
129 zipPath android.WritablePath
130}
131
132type cmakeProcessedProperties struct {
133 LibraryMapping map[string]LibraryMappingProperty
134 PregeneratedPackages []string
135 SystemPackages []string
136}
137
138type cmakeSnapshotDependencyTag struct {
139 blueprint.BaseDependencyTag
140 name string
141}
142
143var (
144 cmakeSnapshotModuleTag = cmakeSnapshotDependencyTag{name: "cmake-snapshot-module"}
145 cmakeSnapshotPrebuiltTag = cmakeSnapshotDependencyTag{name: "cmake-snapshot-prebuilt"}
146)
147
148func parseTemplate(templateContents string) *template.Template {
149 funcMap := template.FuncMap{
150 "setList": func(name string, nameSuffix string, itemPrefix string, items []string) string {
151 var list strings.Builder
152 list.WriteString("set(" + name + nameSuffix)
153 templateListBuilder(&list, itemPrefix, items)
154 return list.String()
155 },
156 "toStrings": func(files android.Paths) []string {
Colin Cross7de1db72024-06-25 14:36:24 -0700157 return files.Strings()
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000158 },
159 "concat5": func(list1 []string, list2 []string, list3 []string, list4 []string, list5 []string) []string {
160 return append(append(append(append(list1, list2...), list3...), list4...), list5...)
161 },
162 "cflagsList": func(name string, nameSuffix string, flags []string,
163 unportableFlags []string, ignoredFlags []string) string {
164 if len(unportableFlags) == 0 {
165 unportableFlags = defaultUnportableFlags
166 }
167
168 var filteredPortable []string
169 var filteredUnportable []string
170 for _, flag := range flags {
171 if slices.Contains(ignoredFlags, flag) {
172 continue
173 } else if slices.Contains(unportableFlags, flag) {
174 filteredUnportable = append(filteredUnportable, flag)
175 } else {
176 filteredPortable = append(filteredPortable, flag)
177 }
178 }
179
180 var list strings.Builder
181
182 list.WriteString("set(" + name + nameSuffix)
183 templateListBuilder(&list, "", filteredPortable)
184
185 if len(filteredUnportable) > 0 {
186 list.WriteString("\nappend_cxx_flags_if_supported(" + name + nameSuffix)
187 templateListBuilder(&list, "", filteredUnportable)
188 }
189
190 return list.String()
191 },
192 "getSources": func(m *Module) android.Paths {
193 return m.compiler.(CompiledInterface).Srcs()
194 },
195 "getModuleType": getModuleType,
196 "getCompilerProperties": func(m *Module) BaseCompilerProperties {
197 return m.compiler.baseCompilerProps()
198 },
Cole Fauste96c16a2024-06-13 14:51:14 -0700199 "getCflagsProperty": func(ctx android.ModuleContext, m *Module) []string {
200 cflags := m.compiler.baseCompilerProps().Cflags
201 return cflags.GetOrDefault(ctx, nil)
202 },
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000203 "getLinkerProperties": func(m *Module) BaseLinkerProperties {
204 return m.linker.baseLinkerProps()
205 },
206 "getExtraLibs": getExtraLibs,
207 "getIncludeDirs": getIncludeDirs,
Tomasz Wasilczyk1e831bf2024-05-10 15:15:21 -0700208 "mapLibraries": func(ctx android.ModuleContext, m *Module, libs []string, mapping map[string]LibraryMappingProperty) []string {
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000209 var mappedLibs []string
210 for _, lib := range libs {
211 mappedLib, exists := mapping[lib]
212 if exists {
213 lib = mappedLib.Mapped_name
214 } else {
Tomasz Wasilczyk1e831bf2024-05-10 15:15:21 -0700215 if !ctx.OtherModuleExists(lib) {
216 ctx.OtherModuleErrorf(m, "Dependency %s doesn't exist", lib)
217 }
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000218 lib = "android::" + lib
219 }
220 if lib == "" {
221 continue
222 }
223 mappedLibs = append(mappedLibs, lib)
224 }
225 sort.Strings(mappedLibs)
226 mappedLibs = slices.Compact(mappedLibs)
227 return mappedLibs
228 },
Tomasz Wasilczyk1e831bf2024-05-10 15:15:21 -0700229 "getAidlSources": func(m *Module) []string {
230 aidlInterface := m.compiler.baseCompilerProps().AidlInterface
231 aidlRoot := aidlInterface.AidlRoot + string(filepath.Separator)
232 if aidlInterface.AidlRoot == "" {
233 aidlRoot = ""
234 }
235 var sources []string
236 for _, src := range aidlInterface.Sources {
237 if !strings.HasPrefix(src, aidlRoot) {
238 panic(fmt.Sprintf("Aidl source '%v' doesn't start with '%v'", src, aidlRoot))
239 }
240 sources = append(sources, src[len(aidlRoot):])
241 }
242 return sources
243 },
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000244 }
245
246 return template.Must(template.New("").Delims("<<", ">>").Funcs(funcMap).Parse(templateContents))
247}
248
249func sliceWithPrefix(prefix string, slice []string) []string {
250 output := make([]string, len(slice))
251 for i, elem := range slice {
252 output[i] = prefix + elem
253 }
254 return output
255}
256
257func templateListBuilder(builder *strings.Builder, itemPrefix string, items []string) {
258 if len(items) > 0 {
259 builder.WriteString("\n")
260 for _, item := range items {
261 builder.WriteString(" " + itemPrefix + item + "\n")
262 }
263 }
264 builder.WriteString(")")
265}
266
267func executeTemplate(templ *template.Template, buffer *bytes.Buffer, data any) string {
268 buffer.Reset()
269 if err := templ.Execute(buffer, data); err != nil {
270 panic(err)
271 }
272 output := strings.TrimSpace(buffer.String())
273 buffer.Reset()
274 return output
275}
276
277func (m *CmakeSnapshot) DepsMutator(ctx android.BottomUpMutatorContext) {
Tomasz Wasilczyk9288b512024-06-27 09:22:12 -0700278 hostVariations := ctx.Config().BuildOSTarget.Variations()
279 ctx.AddVariationDependencies(hostVariations, cmakeSnapshotModuleTag, m.Properties.Modules...)
Tomasz Wasilczyk2493fcc2024-06-20 15:29:09 -0700280
281 if len(m.Properties.Prebuilts) > 0 {
282 prebuilts := append(m.Properties.Prebuilts, "libc++")
Tomasz Wasilczyk9288b512024-06-27 09:22:12 -0700283 ctx.AddVariationDependencies(hostVariations, cmakeSnapshotPrebuiltTag, prebuilts...)
Tomasz Wasilczyk2493fcc2024-06-20 15:29:09 -0700284 }
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000285}
286
287func (m *CmakeSnapshot) GenerateAndroidBuildActions(ctx android.ModuleContext) {
288 var templateBuffer bytes.Buffer
289 var pprop cmakeProcessedProperties
290 m.zipPath = android.PathForModuleOut(ctx, ctx.ModuleName()+".zip")
291
292 // Process Library_mapping for more efficient lookups
293 pprop.LibraryMapping = map[string]LibraryMappingProperty{}
294 for _, elem := range m.Properties.Library_mapping {
295 pprop.LibraryMapping[elem.Android_name] = elem
296
297 if elem.Package_pregenerated != "" {
298 pprop.PregeneratedPackages = append(pprop.PregeneratedPackages, elem.Package_pregenerated)
299 }
300 sort.Strings(pprop.PregeneratedPackages)
301 pprop.PregeneratedPackages = slices.Compact(pprop.PregeneratedPackages)
302
303 if elem.Package_system != "" {
304 pprop.SystemPackages = append(pprop.SystemPackages, elem.Package_system)
305 }
306 sort.Strings(pprop.SystemPackages)
307 pprop.SystemPackages = slices.Compact(pprop.SystemPackages)
308 }
309
310 // Generating CMakeLists.txt rules for all modules in dependency tree
311 moduleDirs := map[string][]string{}
312 sourceFiles := map[string]android.Path{}
313 visitedModules := map[string]bool{}
314 var pregeneratedModules []*Module
315 ctx.WalkDeps(func(dep_a android.Module, parent android.Module) bool {
316 moduleName := ctx.OtherModuleName(dep_a)
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000317 if visited := visitedModules[moduleName]; visited {
318 return false // visit only once
319 }
320 visitedModules[moduleName] = true
Tomasz Wasilczyk1e831bf2024-05-10 15:15:21 -0700321 dep, ok := dep_a.(*Module)
322 if !ok {
323 return false // not a cc module
324 }
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000325 if mapping, ok := pprop.LibraryMapping[moduleName]; ok {
326 if mapping.Package_pregenerated != "" {
327 pregeneratedModules = append(pregeneratedModules, dep)
328 }
329 return false // mapped to system or pregenerated (we'll handle these later)
330 }
331 if ctx.OtherModuleDependencyTag(dep) == cmakeSnapshotPrebuiltTag {
332 return false // we'll handle cmakeSnapshotPrebuiltTag later
333 }
334 if slices.Contains(ignoredSystemLibs, moduleName) {
335 return false // system libs built in-tree for Android
336 }
337 if dep.compiler == nil {
338 return false // unsupported module type (e.g. prebuilt)
339 }
340 isAidlModule := dep.compiler.baseCompilerProps().AidlInterface.Lang != ""
341
342 if !proptools.Bool(dep.Properties.Cmake_snapshot_supported) {
343 ctx.OtherModulePropertyErrorf(dep, "cmake_snapshot_supported",
344 "CMake snapshots not supported, despite being a dependency for %s",
345 ctx.OtherModuleName(parent))
346 return false
347 }
348
349 if veryVerbose {
350 fmt.Println("WalkDeps: " + ctx.OtherModuleName(parent) + " -> " + moduleName)
351 }
352
353 // Generate CMakeLists.txt fragment for this module
354 templateToUse := templateCmakeModuleCc
355 if isAidlModule {
356 templateToUse = templateCmakeModuleAidl
357 }
358 moduleFragment := executeTemplate(templateToUse, &templateBuffer, struct {
359 Ctx *android.ModuleContext
360 M *Module
361 Snapshot *CmakeSnapshot
362 Pprop *cmakeProcessedProperties
363 }{
364 &ctx,
365 dep,
366 m,
367 &pprop,
368 })
369 moduleDir := ctx.OtherModuleDir(dep)
370 moduleDirs[moduleDir] = append(moduleDirs[moduleDir], moduleFragment)
371
372 if m.Properties.Include_sources {
373 files, _ := android.OtherModuleProvider(ctx, dep, cmakeSnapshotSourcesProvider)
374 for _, file := range files {
375 sourceFiles[file.String()] = file
376 }
377 }
378
379 // if it's AIDL module, no need to dive into their dependencies
380 return !isAidlModule
381 })
382
383 // Enumerate sources for pregenerated modules
384 if m.Properties.Include_sources {
385 for _, dep := range pregeneratedModules {
386 if !proptools.Bool(dep.Properties.Cmake_snapshot_supported) {
387 ctx.OtherModulePropertyErrorf(dep, "cmake_snapshot_supported",
388 "Pregenerated CMake snapshots not supported, despite being requested for %s",
389 ctx.ModuleName())
390 continue
391 }
392
393 files, _ := android.OtherModuleProvider(ctx, dep, cmakeSnapshotSourcesProvider)
394 for _, file := range files {
395 sourceFiles[file.String()] = file
396 }
397 }
398 }
399
400 // Merging CMakeLists.txt contents for every module directory
401 var makefilesList android.Paths
Colin Cross7de1db72024-06-25 14:36:24 -0700402 for _, moduleDir := range android.SortedKeys(moduleDirs) {
403 fragments := moduleDirs[moduleDir]
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000404 moduleCmakePath := android.PathForModuleGen(ctx, moduleDir, "CMakeLists.txt")
405 makefilesList = append(makefilesList, moduleCmakePath)
406 sort.Strings(fragments)
407 android.WriteFileRule(ctx, moduleCmakePath, strings.Join(fragments, "\n\n\n"))
408 }
409
410 // Generating top-level CMakeLists.txt
411 mainCmakePath := android.PathForModuleGen(ctx, "CMakeLists.txt")
412 makefilesList = append(makefilesList, mainCmakePath)
413 mainContents := executeTemplate(templateCmakeMain, &templateBuffer, struct {
414 Ctx *android.ModuleContext
415 M *CmakeSnapshot
416 ModuleDirs map[string][]string
417 Pprop *cmakeProcessedProperties
418 }{
419 &ctx,
420 m,
421 moduleDirs,
422 &pprop,
423 })
424 android.WriteFileRule(ctx, mainCmakePath, mainContents)
425
426 // Generating CMake extensions
427 extPath := android.PathForModuleGen(ctx, "cmake", "AppendCxxFlagsIfSupported.cmake")
428 makefilesList = append(makefilesList, extPath)
429 android.WriteFileRuleVerbatim(ctx, extPath, cmakeExtAppendFlags)
430 extPath = android.PathForModuleGen(ctx, "cmake", "AddAidlLibrary.cmake")
431 makefilesList = append(makefilesList, extPath)
432 android.WriteFileRuleVerbatim(ctx, extPath, cmakeExtAddAidlLibrary)
433
434 // Generating the final zip file
435 zipRule := android.NewRuleBuilder(pctx, ctx)
436 zipCmd := zipRule.Command().
437 BuiltTool("soong_zip").
438 FlagWithOutput("-o ", m.zipPath)
439
440 // Packaging all sources into the zip file
441 if m.Properties.Include_sources {
442 var sourcesList android.Paths
Colin Cross7de1db72024-06-25 14:36:24 -0700443 for _, file := range android.SortedKeys(sourceFiles) {
444 path := sourceFiles[file]
445 sourcesList = append(sourcesList, path)
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000446 }
447
448 sourcesRspFile := android.PathForModuleObj(ctx, ctx.ModuleName()+"_sources.rsp")
449 zipCmd.FlagWithRspFileInputList("-r ", sourcesRspFile, sourcesList)
450 }
451
452 // Packaging all make files into the zip file
453 makefilesRspFile := android.PathForModuleObj(ctx, ctx.ModuleName()+"_makefiles.rsp")
454 zipCmd.
455 FlagWithArg("-C ", android.PathForModuleGen(ctx).OutputPath.String()).
456 FlagWithRspFileInputList("-r ", makefilesRspFile, makefilesList)
457
458 // Packaging all prebuilts into the zip file
459 if len(m.Properties.Prebuilts) > 0 {
460 var prebuiltsList android.Paths
461
462 ctx.VisitDirectDepsWithTag(cmakeSnapshotPrebuiltTag, func(dep android.Module) {
463 for _, file := range dep.FilesToInstall() {
464 prebuiltsList = append(prebuiltsList, file)
465 }
466 })
467
468 prebuiltsRspFile := android.PathForModuleObj(ctx, ctx.ModuleName()+"_prebuilts.rsp")
469 zipCmd.
470 FlagWithArg("-C ", android.PathForArbitraryOutput(ctx).String()).
471 FlagWithArg("-P ", "prebuilts").
472 FlagWithRspFileInputList("-r ", prebuiltsRspFile, prebuiltsList)
473 }
474
475 // Finish generating the final zip file
476 zipRule.Build(m.zipPath.String(), "archiving "+ctx.ModuleName())
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000477
mrziwangf95cfa62024-06-18 10:11:39 -0700478 ctx.SetOutputFiles(android.Paths{m.zipPath}, "")
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000479}
480
481func (m *CmakeSnapshot) AndroidMkEntries() []android.AndroidMkEntries {
482 return []android.AndroidMkEntries{{
483 Class: "DATA",
484 OutputFile: android.OptionalPathForPath(m.zipPath),
485 ExtraEntries: []android.AndroidMkExtraEntriesFunc{
486 func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
487 entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true)
488 },
489 },
490 }}
491}
492
493func getModuleType(m *Module) string {
494 switch m.linker.(type) {
495 case *binaryDecorator:
496 return "executable"
497 case *libraryDecorator:
498 return "library"
499 case *testBinary:
Tomasz Wasilczykc3177e02024-06-10 14:38:45 -0700500 return "test"
Tomasz Wasilczyk6e2b8c02024-05-30 07:48:40 -0700501 case *benchmarkDecorator:
Tomasz Wasilczykc3177e02024-06-10 14:38:45 -0700502 return "test"
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000503 }
Tomasz Wasilczyk6e2b8c02024-05-30 07:48:40 -0700504 panic(fmt.Sprintf("Unexpected module type: %T", m.linker))
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000505}
506
507func getExtraLibs(m *Module) []string {
508 switch decorator := m.linker.(type) {
509 case *testBinary:
510 if decorator.testDecorator.gtest() {
Tomasz Wasilczyk6e2b8c02024-05-30 07:48:40 -0700511 return []string{
512 "libgtest",
513 "libgtest_main",
514 }
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000515 }
Tomasz Wasilczyk6e2b8c02024-05-30 07:48:40 -0700516 case *benchmarkDecorator:
517 return []string{"libgoogle-benchmark"}
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000518 }
519 return nil
520}
521
522func getIncludeDirs(ctx android.ModuleContext, m *Module) []string {
523 moduleDir := ctx.OtherModuleDir(m) + string(filepath.Separator)
524 switch decorator := m.compiler.(type) {
525 case *libraryDecorator:
Aleks Todorovc9becde2024-06-10 12:51:53 +0100526 return sliceWithPrefix(moduleDir, decorator.flagExporter.Properties.Export_include_dirs.GetOrDefault(ctx, nil))
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000527 }
528 return nil
529}
530
Tomasz Wasilczykd848dcc2024-05-10 09:16:37 -0700531func cmakeSnapshotLoadHook(ctx android.LoadHookContext) {
532 props := struct {
533 Target struct {
534 Darwin struct {
535 Enabled *bool
536 }
537 Windows struct {
538 Enabled *bool
539 }
540 }
541 }{}
542 props.Target.Darwin.Enabled = proptools.BoolPtr(false)
543 props.Target.Windows.Enabled = proptools.BoolPtr(false)
544 ctx.AppendProperties(&props)
545}
546
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000547// cmake_snapshot allows defining source packages for release outside of Android build tree.
548// As a result of cmake_snapshot module build, a zip file is generated with CMake build definitions
549// for selected source modules, their dependencies and optionally also the source code itself.
550func CmakeSnapshotFactory() android.Module {
551 module := &CmakeSnapshot{}
552 module.AddProperties(&module.Properties)
Tomasz Wasilczykd848dcc2024-05-10 09:16:37 -0700553 android.AddLoadHook(module, cmakeSnapshotLoadHook)
554 android.InitAndroidArchModule(module, android.HostSupported, android.MultilibFirst)
Hao Chen1c8ea5b2023-10-20 23:03:45 +0000555 return module
556}
557
558func init() {
559 android.InitRegistrationContext.RegisterModuleType("cc_cmake_snapshot", CmakeSnapshotFactory)
560}