summaryrefslogtreecommitdiff
path: root/rust/bindgen.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2020-08-04 17:46:22 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-08-04 17:46:22 +0000
commit89e4882d3764dc5c749a630b22381d9ead761500 (patch)
tree8d36850db208a3215e70376b338fbce8c959a960 /rust/bindgen.go
parent9b7b8f169a069bd9011fb7a88174044d6c845760 (diff)
parent26ecd6c5974fcd3ec09792394e7b9cdf32f5f64f (diff)
Merge "[rust] Add SourceProviders as crates support."
Diffstat (limited to 'rust/bindgen.go')
-rw-r--r--rust/bindgen.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/rust/bindgen.go b/rust/bindgen.go
index e8bbb35f1..304f8ec38 100644
--- a/rust/bindgen.go
+++ b/rust/bindgen.go
@@ -61,7 +61,7 @@ type BindgenProperties struct {
Wrapper_src *string `android:"path,arch_variant"`
// list of bindgen-specific flags and options
- Flags []string `android:"arch_variant"`
+ Bindgen_flags []string `android:"arch_variant"`
// list of clang flags required to correctly interpret the headers.
Cflags []string `android:"arch_variant"`
@@ -121,7 +121,7 @@ func (b *bindgenDecorator) generateSource(ctx android.ModuleContext, deps PathDe
}
bindgenFlags := defaultBindgenFlags
- bindgenFlags = append(bindgenFlags, strings.Join(b.Properties.Flags, " "))
+ bindgenFlags = append(bindgenFlags, strings.Join(b.Properties.Bindgen_flags, " "))
wrapperFile := android.OptionalPathForModuleSrc(ctx, b.Properties.Wrapper_src)
if !wrapperFile.Valid() {
@@ -170,7 +170,13 @@ func NewRustBindgen(hod android.HostOrDeviceSupported) (*Module, *bindgenDecorat
baseSourceProvider: NewSourceProvider(),
Properties: BindgenProperties{},
}
+
+ _, library := NewRustLibrary(hod)
+ library.BuildOnlyRust()
+ library.sourceProvider = bindgen
+
module.sourceProvider = bindgen
+ module.compiler = library
return module, bindgen
}