Install symlinks with same suffix and extension as installed file
Move symlink installation into the binaryDecorator so that it can
access the suffix and extension when installing symlinks. Also
consolidates the symlink and symlink_preferred_arch handling.
Test: m -j clang, ls -l out/host/windows-x86/bin/clang++.exe
Change-Id: I1204afb71fac87b276bd6b625b52ee21274855a0
diff --git a/cc/androidmk.go b/cc/androidmk.go
index 709ac59..380babc 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -140,6 +140,11 @@
if Bool(binary.Properties.Static_executable) {
fmt.Fprintln(w, "LOCAL_FORCE_STATIC_EXECUTABLE := true")
}
+
+ if len(binary.symlinks) > 0 {
+ fmt.Fprintln(w, "LOCAL_MODULE_SYMLINKS := "+strings.Join(binary.symlinks, " "))
+ }
+
return nil
})
}
@@ -211,9 +216,6 @@
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := "+filepath.Ext(file))
fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(OUT_DIR)/"+filepath.Clean(dir))
fmt.Fprintln(w, "LOCAL_MODULE_STEM := "+stem)
- if len(installer.Properties.Symlinks) > 0 {
- fmt.Fprintln(w, "LOCAL_MODULE_SYMLINKS := "+strings.Join(installer.Properties.Symlinks, " "))
- }
return nil
})
}