Fix checkbuild with symlinks
Soong delegates installation to make when embedded in make, so it can't
create any dependencies on installed files. Only create the symlink
rules if not embedded in make.
Change-Id: I26d2857e6d544b963a0c52145a8666ba30864838
diff --git a/android/module.go b/android/module.go
index ef20f8d..216aefe 100644
--- a/android/module.go
+++ b/android/module.go
@@ -567,18 +567,20 @@
func (a *androidModuleContext) InstallSymlink(installPath OutputPath, name string, srcPath OutputPath) OutputPath {
fullInstallPath := installPath.Join(a, name)
- a.ModuleBuild(pctx, ModuleBuildParams{
- Rule: Symlink,
- Output: fullInstallPath,
- OrderOnly: Paths{srcPath},
- Default: !a.AConfig().EmbeddedInMake(),
- Args: map[string]string{
- "fromPath": srcPath.String(),
- },
- })
+ if a.Host() || !a.AConfig().SkipDeviceInstall() {
+ a.ModuleBuild(pctx, ModuleBuildParams{
+ Rule: Symlink,
+ Output: fullInstallPath,
+ OrderOnly: Paths{srcPath},
+ Default: !a.AConfig().EmbeddedInMake(),
+ Args: map[string]string{
+ "fromPath": srcPath.String(),
+ },
+ })
- a.installFiles = append(a.installFiles, fullInstallPath)
- a.checkbuildFiles = append(a.checkbuildFiles, srcPath)
+ a.installFiles = append(a.installFiles, fullInstallPath)
+ a.checkbuildFiles = append(a.checkbuildFiles, srcPath)
+ }
return fullInstallPath
}