blob: a9321bef23fb0f80ba69f6a5eae076880e2228fc [file] [log] [blame]
Ivan Lozanoffee3342019-08-27 12:03:00 -07001// 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
15package rust
16
17import (
Ivan Lozano183a3212019-10-18 14:18:45 -070018 "fmt"
Ivan Lozanoffee3342019-08-27 12:03:00 -070019 "strings"
20
21 "github.com/google/blueprint"
22 "github.com/google/blueprint/proptools"
23
24 "android/soong/android"
25 "android/soong/cc"
26 "android/soong/rust/config"
27)
28
29var pctx = android.NewPackageContext("android/soong/rust")
30
31func init() {
32 // Only allow rust modules to be defined for certain projects
Ivan Lozanoffee3342019-08-27 12:03:00 -070033
34 android.AddNeverAllowRules(
35 android.NeverAllow().
Ivan Lozanoe169ad72019-09-18 08:42:54 -070036 NotIn(config.RustAllowedPaths...).
37 ModuleType(config.RustModuleTypes...))
Ivan Lozanoffee3342019-08-27 12:03:00 -070038
39 android.RegisterModuleType("rust_defaults", defaultsFactory)
40 android.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
41 ctx.BottomUp("rust_libraries", LibraryMutator).Parallel()
42 })
43 pctx.Import("android/soong/rust/config")
44}
45
46type Flags struct {
Ivan Lozanof1c84332019-09-20 11:00:37 -070047 GlobalRustFlags []string // Flags that apply globally to rust
48 GlobalLinkFlags []string // Flags that apply globally to linker
49 RustFlags []string // Flags that apply to rust
50 LinkFlags []string // Flags that apply to linker
51 RustFlagsDeps android.Paths // Files depended on by compiler flags
52 Toolchain config.Toolchain
Ivan Lozanoffee3342019-08-27 12:03:00 -070053}
54
55type BaseProperties struct {
56 AndroidMkRlibs []string
57 AndroidMkDylibs []string
58 AndroidMkProcMacroLibs []string
59 AndroidMkSharedLibs []string
60 AndroidMkStaticLibs []string
61}
62
63type Module struct {
64 android.ModuleBase
65 android.DefaultableModuleBase
66
67 Properties BaseProperties
68
69 hod android.HostOrDeviceSupported
70 multilib android.Multilib
71
72 compiler compiler
73 cachedToolchain config.Toolchain
74 subAndroidMkOnce map[subAndroidMkProvider]bool
75 outputFile android.OptionalPath
76}
77
78type Deps struct {
79 Dylibs []string
80 Rlibs []string
81 ProcMacros []string
82 SharedLibs []string
83 StaticLibs []string
84
85 CrtBegin, CrtEnd string
86}
87
88type PathDeps struct {
89 DyLibs RustLibraries
90 RLibs RustLibraries
91 SharedLibs android.Paths
92 StaticLibs android.Paths
93 ProcMacros RustLibraries
94 linkDirs []string
95 depFlags []string
96 //ReexportedDeps android.Paths
Ivan Lozanof1c84332019-09-20 11:00:37 -070097
98 CrtBegin android.OptionalPath
99 CrtEnd android.OptionalPath
Ivan Lozanoffee3342019-08-27 12:03:00 -0700100}
101
102type RustLibraries []RustLibrary
103
104type RustLibrary struct {
105 Path android.Path
106 CrateName string
107}
108
109type compiler interface {
110 compilerFlags(ctx ModuleContext, flags Flags) Flags
111 compilerProps() []interface{}
112 compile(ctx ModuleContext, flags Flags, deps PathDeps) android.Path
113 compilerDeps(ctx DepsContext, deps Deps) Deps
114 crateName() string
115
116 install(ctx ModuleContext, path android.Path)
117 relativeInstallPath() string
118}
119
120func defaultsFactory() android.Module {
121 return DefaultsFactory()
122}
123
124type Defaults struct {
125 android.ModuleBase
126 android.DefaultsModuleBase
127}
128
129func DefaultsFactory(props ...interface{}) android.Module {
130 module := &Defaults{}
131
132 module.AddProperties(props...)
133 module.AddProperties(
134 &BaseProperties{},
135 &BaseCompilerProperties{},
136 &BinaryCompilerProperties{},
137 &LibraryCompilerProperties{},
138 &ProcMacroCompilerProperties{},
139 &PrebuiltProperties{},
140 )
141
142 android.InitDefaultsModule(module)
143 return module
144}
145
146func (mod *Module) CrateName() string {
147 if mod.compiler != nil && mod.compiler.crateName() != "" {
148 return mod.compiler.crateName()
149 }
150 // Default crate names replace '-' in the name to '_'
151 return strings.Replace(mod.BaseModuleName(), "-", "_", -1)
152}
153
Ivan Lozano183a3212019-10-18 14:18:45 -0700154func (mod *Module) CcLibrary() bool {
155 if mod.compiler != nil {
156 if _, ok := mod.compiler.(*libraryDecorator); ok {
157 return true
158 }
159 }
160 return false
161}
162
163func (mod *Module) CcLibraryInterface() bool {
164 if mod.compiler != nil {
165 if _, ok := mod.compiler.(libraryInterface); ok {
166 return true
167 }
168 }
169 return false
170}
171
172func (mod *Module) IncludeDirs() android.Paths {
173 if mod.compiler != nil {
174 if _, ok := mod.compiler.(*libraryDecorator); ok {
175 //TODO add Include_dirs to libraryDecorator for C libraries.
176 return android.Paths{}
177 }
178 }
179 panic(fmt.Errorf("IncludeDirs called on non-library module: %q", mod.BaseModuleName()))
180}
181
182func (mod *Module) SetStatic() {
183 if mod.compiler != nil {
184 if _, ok := mod.compiler.(*libraryDecorator); ok {
185 //TODO add support for static variants.
186 return
187 }
188 }
189 panic(fmt.Errorf("SetStatic called on non-library module: %q", mod.BaseModuleName()))
190}
191
192func (mod *Module) SetShared() {
193 if mod.compiler != nil {
194 if _, ok := mod.compiler.(*libraryDecorator); ok {
195 //TODO add support for shared variants.
196 return
197 }
198 }
199 panic(fmt.Errorf("SetShared called on non-library module: %q", mod.BaseModuleName()))
200}
201
202func (mod *Module) SetBuildStubs() {
203 panic("SetBuildStubs not yet implemented for rust modules")
204}
205
206func (mod *Module) SetStubsVersions(string) {
207 panic("SetStubsVersions not yet implemented for rust modules")
208}
209
210func (mod *Module) BuildStaticVariant() bool {
211 if mod.compiler != nil {
212 if _, ok := mod.compiler.(*libraryDecorator); ok {
213 //TODO add support for static variants.
214 return false
215 }
216 }
217 panic(fmt.Errorf("BuildStaticVariant called on non-library module: %q", mod.BaseModuleName()))
218}
219
220func (mod *Module) BuildSharedVariant() bool {
221 if mod.compiler != nil {
222 if _, ok := mod.compiler.(*libraryDecorator); ok {
223 //TODO add support for shared variants.
224 return false
225 }
226 }
227 panic(fmt.Errorf("BuildSharedVariant called on non-library module: %q", mod.BaseModuleName()))
228}
229
230// Rust module deps don't have a link order (?)
231func (mod *Module) SetDepsInLinkOrder([]android.Path) {}
232
233func (mod *Module) GetDepsInLinkOrder() []android.Path {
234 return []android.Path{}
235}
236
237func (mod *Module) GetStaticVariant() cc.LinkableInterface {
238 return nil
239}
240
241func (mod *Module) Module() android.Module {
242 return mod
243}
244
245func (mod *Module) StubsVersions() []string {
246 // For now, Rust has no stubs versions.
247 if mod.compiler != nil {
248 if _, ok := mod.compiler.(*libraryDecorator); ok {
249 return []string{}
250 }
251 }
252 panic(fmt.Errorf("StubsVersions called on non-library module: %q", mod.BaseModuleName()))
253}
254
255func (mod *Module) OutputFile() android.OptionalPath {
256 return mod.outputFile
257}
258
259func (mod *Module) InRecovery() bool {
260 // For now, Rust has no notion of the recovery image
261 return false
262}
263func (mod *Module) HasStaticVariant() bool {
264 if mod.GetStaticVariant() != nil {
265 return true
266 }
267 return false
268}
269
270var _ cc.LinkableInterface = (*Module)(nil)
271
Ivan Lozanoffee3342019-08-27 12:03:00 -0700272func (mod *Module) Init() android.Module {
273 mod.AddProperties(&mod.Properties)
274
275 if mod.compiler != nil {
276 mod.AddProperties(mod.compiler.compilerProps()...)
277 }
278 android.InitAndroidArchModule(mod, mod.hod, mod.multilib)
279
280 android.InitDefaultableModule(mod)
281
Ivan Lozanode252912019-09-06 15:29:52 -0700282 // Explicitly disable unsupported targets.
283 android.AddLoadHook(mod, func(ctx android.LoadHookContext) {
284 disableTargets := struct {
285 Target struct {
Ivan Lozanode252912019-09-06 15:29:52 -0700286 Linux_bionic struct {
287 Enabled *bool
288 }
289 }
290 }{}
Ivan Lozanode252912019-09-06 15:29:52 -0700291 disableTargets.Target.Linux_bionic.Enabled = proptools.BoolPtr(false)
292
293 ctx.AppendProperties(&disableTargets)
294 })
295
Ivan Lozanoffee3342019-08-27 12:03:00 -0700296 return mod
297}
298
299func newBaseModule(hod android.HostOrDeviceSupported, multilib android.Multilib) *Module {
300 return &Module{
301 hod: hod,
302 multilib: multilib,
303 }
304}
305func newModule(hod android.HostOrDeviceSupported, multilib android.Multilib) *Module {
306 module := newBaseModule(hod, multilib)
307 return module
308}
309
310type ModuleContext interface {
311 android.ModuleContext
312 ModuleContextIntf
313}
314
315type BaseModuleContext interface {
316 android.BaseModuleContext
317 ModuleContextIntf
318}
319
320type DepsContext interface {
321 android.BottomUpMutatorContext
322 ModuleContextIntf
323}
324
325type ModuleContextIntf interface {
326 toolchain() config.Toolchain
327 baseModuleName() string
328 CrateName() string
329}
330
331type depsContext struct {
332 android.BottomUpMutatorContext
333 moduleContextImpl
334}
335
336type moduleContext struct {
337 android.ModuleContext
338 moduleContextImpl
339}
340
341type moduleContextImpl struct {
342 mod *Module
343 ctx BaseModuleContext
344}
345
346func (ctx *moduleContextImpl) toolchain() config.Toolchain {
347 return ctx.mod.toolchain(ctx.ctx)
348}
349
350func (mod *Module) toolchain(ctx android.BaseModuleContext) config.Toolchain {
351 if mod.cachedToolchain == nil {
352 mod.cachedToolchain = config.FindToolchain(ctx.Os(), ctx.Arch())
353 }
354 return mod.cachedToolchain
355}
356
357func (d *Defaults) GenerateAndroidBuildActions(ctx android.ModuleContext) {
358}
359
360func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
361 ctx := &moduleContext{
362 ModuleContext: actx,
363 moduleContextImpl: moduleContextImpl{
364 mod: mod,
365 },
366 }
367 ctx.ctx = ctx
368
369 toolchain := mod.toolchain(ctx)
370
371 if !toolchain.Supported() {
372 // This toolchain's unsupported, there's nothing to do for this mod.
373 return
374 }
375
376 deps := mod.depsToPaths(ctx)
377 flags := Flags{
378 Toolchain: toolchain,
379 }
380
381 if mod.compiler != nil {
382 flags = mod.compiler.compilerFlags(ctx, flags)
383 outputFile := mod.compiler.compile(ctx, flags, deps)
384 mod.outputFile = android.OptionalPathForPath(outputFile)
385 mod.compiler.install(ctx, mod.outputFile.Path())
386 }
387}
388
389func (mod *Module) deps(ctx DepsContext) Deps {
390 deps := Deps{}
391
392 if mod.compiler != nil {
393 deps = mod.compiler.compilerDeps(ctx, deps)
394 }
395
396 deps.Rlibs = android.LastUniqueStrings(deps.Rlibs)
397 deps.Dylibs = android.LastUniqueStrings(deps.Dylibs)
398 deps.ProcMacros = android.LastUniqueStrings(deps.ProcMacros)
399 deps.SharedLibs = android.LastUniqueStrings(deps.SharedLibs)
400 deps.StaticLibs = android.LastUniqueStrings(deps.StaticLibs)
401
402 return deps
403
404}
405
406func (ctx *moduleContextImpl) baseModuleName() string {
407 return ctx.mod.ModuleBase.BaseModuleName()
408}
409
410func (ctx *moduleContextImpl) CrateName() string {
411 return ctx.mod.CrateName()
412}
413
414type dependencyTag struct {
415 blueprint.BaseDependencyTag
416 name string
417 library bool
418 proc_macro bool
419}
420
421var (
422 rlibDepTag = dependencyTag{name: "rlibTag", library: true}
423 dylibDepTag = dependencyTag{name: "dylib", library: true}
424 procMacroDepTag = dependencyTag{name: "procMacro", proc_macro: true}
425)
426
427func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
428 var depPaths PathDeps
429
430 directRlibDeps := []*Module{}
431 directDylibDeps := []*Module{}
432 directProcMacroDeps := []*Module{}
433 directSharedLibDeps := []*(cc.Module){}
434 directStaticLibDeps := []*(cc.Module){}
435
436 ctx.VisitDirectDeps(func(dep android.Module) {
437 depName := ctx.OtherModuleName(dep)
438 depTag := ctx.OtherModuleDependencyTag(dep)
Ivan Lozanoffee3342019-08-27 12:03:00 -0700439
440 if rustDep, ok := dep.(*Module); ok {
441 //Handle Rust Modules
Ivan Lozano70e0a072019-09-13 14:23:15 -0700442
Ivan Lozanoffee3342019-08-27 12:03:00 -0700443 linkFile := rustDep.outputFile
444 if !linkFile.Valid() {
445 ctx.ModuleErrorf("Invalid output file when adding dep %q to %q", depName, ctx.ModuleName())
446 }
447
448 switch depTag {
449 case dylibDepTag:
450 dylib, ok := rustDep.compiler.(libraryInterface)
451 if !ok || !dylib.dylib() {
452 ctx.ModuleErrorf("mod %q not an dylib library", depName)
453 return
454 }
455 directDylibDeps = append(directDylibDeps, rustDep)
456 mod.Properties.AndroidMkDylibs = append(mod.Properties.AndroidMkDylibs, depName)
457 case rlibDepTag:
458 rlib, ok := rustDep.compiler.(libraryInterface)
459 if !ok || !rlib.rlib() {
460 ctx.ModuleErrorf("mod %q not an rlib library", depName)
461 return
462 }
463 directRlibDeps = append(directRlibDeps, rustDep)
464 mod.Properties.AndroidMkRlibs = append(mod.Properties.AndroidMkRlibs, depName)
465 case procMacroDepTag:
466 directProcMacroDeps = append(directProcMacroDeps, rustDep)
467 mod.Properties.AndroidMkProcMacroLibs = append(mod.Properties.AndroidMkProcMacroLibs, depName)
468 }
469
470 //Append the dependencies exportedDirs
471 if lib, ok := rustDep.compiler.(*libraryDecorator); ok {
472 depPaths.linkDirs = append(depPaths.linkDirs, lib.exportedDirs()...)
473 depPaths.depFlags = append(depPaths.depFlags, lib.exportedDepFlags()...)
Ivan Lozanoffee3342019-08-27 12:03:00 -0700474 }
475
476 // Append this dependencies output to this mod's linkDirs so they can be exported to dependencies
477 // This can be probably be refactored by defining a common exporter interface similar to cc's
478 if depTag == dylibDepTag || depTag == rlibDepTag || depTag == procMacroDepTag {
479 linkDir := linkPathFromFilePath(linkFile.Path())
480 if lib, ok := mod.compiler.(*libraryDecorator); ok {
481 lib.linkDirs = append(lib.linkDirs, linkDir)
482 } else if procMacro, ok := mod.compiler.(*procMacroDecorator); ok {
483 procMacro.linkDirs = append(procMacro.linkDirs, linkDir)
484 }
485 }
486
487 } else if ccDep, ok := dep.(*cc.Module); ok {
Ivan Lozanoffee3342019-08-27 12:03:00 -0700488 //Handle C dependencies
Ivan Lozano70e0a072019-09-13 14:23:15 -0700489
490 if ccDep.Target().Os != ctx.Os() {
491 ctx.ModuleErrorf("OS mismatch between %q and %q", ctx.ModuleName(), depName)
492 return
493 }
494 if ccDep.Target().Arch.ArchType != ctx.Arch().ArchType {
495 ctx.ModuleErrorf("Arch mismatch between %q and %q", ctx.ModuleName(), depName)
496 return
497 }
498
Ivan Lozanoffee3342019-08-27 12:03:00 -0700499 linkFile := ccDep.OutputFile()
500 linkPath := linkPathFromFilePath(linkFile.Path())
501 libName := libNameFromFilePath(linkFile.Path())
502 if !linkFile.Valid() {
503 ctx.ModuleErrorf("Invalid output file when adding dep %q to %q", depName, ctx.ModuleName())
504 }
505
506 exportDep := false
507
508 switch depTag {
Ivan Lozano183a3212019-10-18 14:18:45 -0700509 case cc.StaticDepTag:
Ivan Lozanoffee3342019-08-27 12:03:00 -0700510 depPaths.linkDirs = append(depPaths.linkDirs, linkPath)
511 depPaths.depFlags = append(depPaths.depFlags, "-l"+libName)
512 directStaticLibDeps = append(directStaticLibDeps, ccDep)
513 mod.Properties.AndroidMkStaticLibs = append(mod.Properties.AndroidMkStaticLibs, depName)
Ivan Lozano183a3212019-10-18 14:18:45 -0700514 case cc.SharedDepTag:
Ivan Lozanoffee3342019-08-27 12:03:00 -0700515 depPaths.linkDirs = append(depPaths.linkDirs, linkPath)
516 depPaths.depFlags = append(depPaths.depFlags, "-l"+libName)
517 directSharedLibDeps = append(directSharedLibDeps, ccDep)
518 mod.Properties.AndroidMkSharedLibs = append(mod.Properties.AndroidMkSharedLibs, depName)
519 exportDep = true
Ivan Lozano183a3212019-10-18 14:18:45 -0700520 case cc.CrtBeginDepTag:
Ivan Lozanof1c84332019-09-20 11:00:37 -0700521 depPaths.CrtBegin = linkFile
Ivan Lozano183a3212019-10-18 14:18:45 -0700522 case cc.CrtEndDepTag:
Ivan Lozanof1c84332019-09-20 11:00:37 -0700523 depPaths.CrtEnd = linkFile
Ivan Lozanoffee3342019-08-27 12:03:00 -0700524 }
525
526 // Make sure these dependencies are propagated
527 if lib, ok := mod.compiler.(*libraryDecorator); ok && (exportDep || lib.rlib()) {
528 lib.linkDirs = append(lib.linkDirs, linkPath)
529 lib.depFlags = append(lib.depFlags, "-l"+libName)
530 } else if procMacro, ok := mod.compiler.(*procMacroDecorator); ok && exportDep {
531 procMacro.linkDirs = append(procMacro.linkDirs, linkPath)
532 procMacro.depFlags = append(procMacro.depFlags, "-l"+libName)
533 }
534
535 }
536 })
537
538 var rlibDepFiles RustLibraries
539 for _, dep := range directRlibDeps {
540 rlibDepFiles = append(rlibDepFiles, RustLibrary{Path: dep.outputFile.Path(), CrateName: dep.CrateName()})
541 }
542 var dylibDepFiles RustLibraries
543 for _, dep := range directDylibDeps {
544 dylibDepFiles = append(dylibDepFiles, RustLibrary{Path: dep.outputFile.Path(), CrateName: dep.CrateName()})
545 }
546 var procMacroDepFiles RustLibraries
547 for _, dep := range directProcMacroDeps {
548 procMacroDepFiles = append(procMacroDepFiles, RustLibrary{Path: dep.outputFile.Path(), CrateName: dep.CrateName()})
549 }
550
551 var staticLibDepFiles android.Paths
552 for _, dep := range directStaticLibDeps {
553 staticLibDepFiles = append(staticLibDepFiles, dep.OutputFile().Path())
554 }
555
556 var sharedLibDepFiles android.Paths
557 for _, dep := range directSharedLibDeps {
558 sharedLibDepFiles = append(sharedLibDepFiles, dep.OutputFile().Path())
559 }
560
561 depPaths.RLibs = append(depPaths.RLibs, rlibDepFiles...)
562 depPaths.DyLibs = append(depPaths.DyLibs, dylibDepFiles...)
563 depPaths.SharedLibs = append(depPaths.SharedLibs, sharedLibDepFiles...)
564 depPaths.StaticLibs = append(depPaths.StaticLibs, staticLibDepFiles...)
565 depPaths.ProcMacros = append(depPaths.ProcMacros, procMacroDepFiles...)
566
567 // Dedup exported flags from dependencies
568 depPaths.linkDirs = android.FirstUniqueStrings(depPaths.linkDirs)
569 depPaths.depFlags = android.FirstUniqueStrings(depPaths.depFlags)
570
571 return depPaths
572}
573
574func linkPathFromFilePath(filepath android.Path) string {
575 return strings.Split(filepath.String(), filepath.Base())[0]
576}
577func libNameFromFilePath(filepath android.Path) string {
578 libName := strings.Split(filepath.Base(), filepath.Ext())[0]
579 if strings.Contains(libName, "lib") {
580 libName = strings.Split(libName, "lib")[1]
581 }
582 return libName
583}
584func (mod *Module) DepsMutator(actx android.BottomUpMutatorContext) {
585 ctx := &depsContext{
586 BottomUpMutatorContext: actx,
587 moduleContextImpl: moduleContextImpl{
588 mod: mod,
589 },
590 }
591 ctx.ctx = ctx
592
593 deps := mod.deps(ctx)
594
595 actx.AddVariationDependencies([]blueprint.Variation{{Mutator: "rust_libraries", Variation: "rlib"}}, rlibDepTag, deps.Rlibs...)
596 actx.AddVariationDependencies([]blueprint.Variation{{Mutator: "rust_libraries", Variation: "dylib"}}, dylibDepTag, deps.Dylibs...)
597
598 ccDepVariations := []blueprint.Variation{}
599 ccDepVariations = append(ccDepVariations, blueprint.Variation{Mutator: "version", Variation: ""})
600 if !mod.Host() {
601 ccDepVariations = append(ccDepVariations, blueprint.Variation{Mutator: "image", Variation: "core"})
602 }
Ivan Lozano183a3212019-10-18 14:18:45 -0700603 actx.AddVariationDependencies(append(ccDepVariations, blueprint.Variation{Mutator: "link", Variation: "shared"}), cc.SharedDepTag, deps.SharedLibs...)
604 actx.AddVariationDependencies(append(ccDepVariations, blueprint.Variation{Mutator: "link", Variation: "static"}), cc.StaticDepTag, deps.StaticLibs...)
Ivan Lozano5ca5ef62019-09-23 10:10:40 -0700605
Ivan Lozanof1c84332019-09-20 11:00:37 -0700606 if deps.CrtBegin != "" {
Ivan Lozano183a3212019-10-18 14:18:45 -0700607 actx.AddVariationDependencies(ccDepVariations, cc.CrtBeginDepTag, deps.CrtBegin)
Ivan Lozanof1c84332019-09-20 11:00:37 -0700608 }
609 if deps.CrtEnd != "" {
Ivan Lozano183a3212019-10-18 14:18:45 -0700610 actx.AddVariationDependencies(ccDepVariations, cc.CrtEndDepTag, deps.CrtEnd)
Ivan Lozanof1c84332019-09-20 11:00:37 -0700611 }
612
Ivan Lozano5ca5ef62019-09-23 10:10:40 -0700613 // proc_macros are compiler plugins, and so we need the host arch variant as a dependendcy.
Colin Cross0f7d2ef2019-10-16 11:03:10 -0700614 actx.AddFarVariationDependencies(ctx.Config().BuildOSTarget.Variations(), procMacroDepTag, deps.ProcMacros...)
Ivan Lozanoffee3342019-08-27 12:03:00 -0700615}
616
617func (mod *Module) Name() string {
618 name := mod.ModuleBase.Name()
619 if p, ok := mod.compiler.(interface {
620 Name(string) string
621 }); ok {
622 name = p.Name(name)
623 }
624 return name
625}
626
627var Bool = proptools.Bool
628var BoolDefault = proptools.BoolDefault
629var String = proptools.String
630var StringPtr = proptools.StringPtr