diff options
| author | 2020-08-05 19:08:20 +0000 | |
|---|---|---|
| committer | 2020-08-05 19:08:20 +0000 | |
| commit | 80668b07d27da4cb49a3b416ee0513c0400a6150 (patch) | |
| tree | 85da39b7675a0976826c004560b75e1fbe2358aa /rust/rust.go | |
| parent | 9c55b0efa2e1aa43661e9876b7070b4fdbe6031d (diff) | |
| parent | c564d2d5a46af4c213e424ee5a7ad7ff9cb2ba3a (diff) | |
Merge "Add support for custom bindgen binaries."
Diffstat (limited to 'rust/rust.go')
| -rw-r--r-- | rust/rust.go | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/rust/rust.go b/rust/rust.go index 01952477e..7ec2d736b 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -722,10 +722,11 @@ type dependencyTag struct { } var ( - rlibDepTag = dependencyTag{name: "rlibTag", library: true} - dylibDepTag = dependencyTag{name: "dylib", library: true} - procMacroDepTag = dependencyTag{name: "procMacro", proc_macro: true} - testPerSrcDepTag = dependencyTag{name: "rust_unit_tests"} + customBindgenDepTag = dependencyTag{name: "customBindgenTag"} + rlibDepTag = dependencyTag{name: "rlibTag", library: true} + dylibDepTag = dependencyTag{name: "dylib", library: true} + procMacroDepTag = dependencyTag{name: "procMacro", proc_macro: true} + testPerSrcDepTag = dependencyTag{name: "rust_unit_tests"} ) type autoDep struct { @@ -1009,6 +1010,13 @@ func (mod *Module) DepsMutator(actx android.BottomUpMutatorContext) { actx.AddVariationDependencies(commonDepVariations, cc.CrtEndDepTag, deps.CrtEnd) } + if mod.sourceProvider != nil { + if bindgen, ok := mod.sourceProvider.(*bindgenDecorator); ok && + bindgen.Properties.Custom_bindgen != "" { + actx.AddFarVariationDependencies(ctx.Config().BuildOSTarget.Variations(), customBindgenDepTag, + bindgen.Properties.Custom_bindgen) + } + } // proc_macros are compiler plugins, and so we need the host arch variant as a dependendcy. actx.AddFarVariationDependencies(ctx.Config().BuildOSTarget.Variations(), procMacroDepTag, deps.ProcMacros...) } |