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

Commit 9a988c4f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "rust: Don't suppress adding deps for rust-project.json device override" into main

parents 39b53626 c1e0cb69
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ func (singleton *projectGeneratorSingleton) mergeDependencies(ctx android.Single
		var childId int
		cInfo, known := singleton.knownCrates[rChild.Name()]
		if !known {
			childId, ok = singleton.addCrate(ctx, rChild, make(map[string]int))
			childId, ok = singleton.addCrate(ctx, rChild)
			if !ok {
				return
			}
@@ -128,7 +128,8 @@ func isModuleSupported(ctx android.SingletonContext, module android.Module) (*Mo
// addCrate adds a crate to singleton.project.Crates ensuring that required
// dependencies are also added. It returns the index of the new crate in
// singleton.project.Crates
func (singleton *projectGeneratorSingleton) addCrate(ctx android.SingletonContext, rModule *Module, deps map[string]int) (int, bool) {
func (singleton *projectGeneratorSingleton) addCrate(ctx android.SingletonContext, rModule *Module) (int, bool) {
	deps := make(map[string]int)
	rootModule, err := rModule.compiler.checkedCrateRootPath()
	if err != nil {
		return 0, false
@@ -180,7 +181,7 @@ func (singleton *projectGeneratorSingleton) appendCrateAndDependencies(ctx andro
	if cInfo, ok := singleton.knownCrates[module.Name()]; ok {
		// If we have a new device variant, override the old one
		if !cInfo.Device && rModule.Device() {
			singleton.addCrate(ctx, rModule, cInfo.Deps)
			singleton.addCrate(ctx, rModule)
			return
		}
		crate := singleton.project.Crates[cInfo.Idx]
@@ -188,7 +189,7 @@ func (singleton *projectGeneratorSingleton) appendCrateAndDependencies(ctx andro
		singleton.project.Crates[cInfo.Idx] = crate
		return
	}
	singleton.addCrate(ctx, rModule, make(map[string]int))
	singleton.addCrate(ctx, rModule)
}

func (singleton *projectGeneratorSingleton) GenerateBuildActions(ctx android.SingletonContext) {