summaryrefslogtreecommitdiff
path: root/rust/androidmk.go
diff options
context:
space:
mode:
Diffstat (limited to 'rust/androidmk.go')
-rw-r--r--rust/androidmk.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/rust/androidmk.go b/rust/androidmk.go
index 630805a85..c9f648632 100644
--- a/rust/androidmk.go
+++ b/rust/androidmk.go
@@ -50,7 +50,7 @@ func (mod *Module) AndroidMkEntries() []android.AndroidMkEntries {
}
ret := android.AndroidMkEntries{
- OutputFile: mod.unstrippedOutputFile,
+ OutputFile: android.OptionalPathForPath(mod.UnstrippedOutputFile()),
Include: "$(BUILD_SYSTEM)/soong_rust_prebuilt.mk",
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
@@ -137,10 +137,15 @@ func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.An
} else if library.shared() {
ret.Class = "SHARED_LIBRARIES"
}
-
if library.distFile.Valid() {
ret.DistFiles = android.MakeDefaultDistFiles(library.distFile.Path())
}
+ ret.ExtraEntries = append(ret.ExtraEntries,
+ func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
+ if library.tocFile.Valid() {
+ entries.SetString("LOCAL_SOONG_TOC", library.tocFile.String())
+ }
+ })
}
func (procMacro *procMacroDecorator) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkEntries) {
@@ -181,18 +186,13 @@ func (compiler *baseCompiler) AndroidMk(ctx AndroidMkContext, ret *android.Andro
return
}
- var unstrippedOutputFile android.OptionalPath
- // Soong installation is only supported for host modules. Have Make
- // installation trigger Soong installation.
- if ctx.Target().Os.Class == android.Host {
- ret.OutputFile = android.OptionalPathForPath(compiler.path)
- } else if compiler.strippedOutputFile.Valid() {
- unstrippedOutputFile = ret.OutputFile
+ if compiler.strippedOutputFile.Valid() {
ret.OutputFile = compiler.strippedOutputFile
}
+
ret.ExtraEntries = append(ret.ExtraEntries,
func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
- entries.SetOptionalPath("LOCAL_SOONG_UNSTRIPPED_BINARY", unstrippedOutputFile)
+ entries.SetPath("LOCAL_SOONG_UNSTRIPPED_BINARY", compiler.unstrippedOutputFile)
path, file := filepath.Split(compiler.path.ToMakePath().String())
stem, suffix, _ := android.SplitFileExt(file)
entries.SetString("LOCAL_MODULE_SUFFIX", suffix)