Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e94f3e73 authored by Matthew Maurer's avatar Matthew Maurer
Browse files

Revert^4 "rust: Only allow bindgen to produce `rlib`s."

199c1885

Change-Id: I28b353fa89354cc572806b2274169342a473a03c
parent 199c1885
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -299,7 +299,15 @@ func NewRustBindgen(hod android.HostOrDeviceSupported) (*Module, *bindgenDecorat
		ClangProperties:    cc.RustBindgenClangProperties{},
	}

	module := NewSourceProviderModule(hod, bindgen, false)
	module := NewSourceProviderModule(hod, bindgen, false, true)

	android.AddLoadHook(module, func(ctx android.LoadHookContext) {
		type stub_props struct {
			Visibility []string
		}
		props := &stub_props{[]string{":__subpackages__"}}
		ctx.PrependProperties(props)
	})

	return module, bindgen
}
+1 −1
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ func NewRustProtobuf(hod android.HostOrDeviceSupported) (*Module, *protobufDecor
		Properties:         ProtobufProperties{},
	}

	module := NewSourceProviderModule(hod, protobuf, false)
	module := NewSourceProviderModule(hod, protobuf, false, false)

	return module, protobuf
}
+4 −1
Original line number Diff line number Diff line
@@ -65,9 +65,12 @@ func NewSourceProvider() *BaseSourceProvider {
	}
}

func NewSourceProviderModule(hod android.HostOrDeviceSupported, sourceProvider SourceProvider, enableLints bool) *Module {
func NewSourceProviderModule(hod android.HostOrDeviceSupported, sourceProvider SourceProvider, enableLints bool, rlibOnly bool) *Module {
	_, library := NewRustLibrary(hod)
	library.BuildOnlyRust()
	if rlibOnly {
		library.BuildOnlyRlib()
	}
	library.sourceProvider = sourceProvider

	module := newModule(hod, android.MultilibBoth)