Annotate dependency tags for dependencies of installed files
Relands Ic22603a5c0718b5a21686672a7471f952b4d1017 with a minor change to track libc++ dependencies for python hosts and after a fix to an internal genrule that depended on transitively installed java libraries (ag/13068670). Soong currently assumes that installed files should depend on installed files of all transitive dependencies, which results in extra installed file dependencies through genrules, static libs, etc. Annotate dependency tags for dependencies for which the installed files are necessary such as shared libraries and JNI libraries. This avoids extra installed files, and is also a first step towards genrules using their own copy of tools instead of the installed copy. Bug: 124313442 Test: m checkbuild Test: java.TestBinary Test: cc.TestInstallSharedLibs Test: deptag_test.go Change-Id: I725871249d561428e6f67bba6a7c65b580012b72
This commit is contained in:
24
cc/cc.go
24
cc/cc.go
@@ -551,7 +551,15 @@ func (d libraryDependencyTag) static() bool {
|
||||
return d.Kind == staticLibraryDependency
|
||||
}
|
||||
|
||||
// dependencyTag is used for tagging miscellanous dependency types that don't fit into
|
||||
// InstallDepNeeded returns true for shared libraries so that shared library dependencies of
|
||||
// binaries or other shared libraries are installed as dependencies.
|
||||
func (d libraryDependencyTag) InstallDepNeeded() bool {
|
||||
return d.shared()
|
||||
}
|
||||
|
||||
var _ android.InstallNeededDependencyTag = libraryDependencyTag{}
|
||||
|
||||
// dependencyTag is used for tagging miscellaneous dependency types that don't fit into
|
||||
// libraryDependencyTag. Each tag object is created globally and reused for multiple
|
||||
// dependencies (although since the object contains no references, assigning a tag to a
|
||||
// variable and modifying it will not modify the original). Users can compare the tag
|
||||
@@ -561,6 +569,15 @@ type dependencyTag struct {
|
||||
name string
|
||||
}
|
||||
|
||||
// installDependencyTag is used for tagging miscellaneous dependency types that don't fit into
|
||||
// libraryDependencyTag, but where the dependency needs to be installed when the parent is
|
||||
// installed.
|
||||
type installDependencyTag struct {
|
||||
blueprint.BaseDependencyTag
|
||||
android.InstallAlwaysNeededDependencyTag
|
||||
name string
|
||||
}
|
||||
|
||||
var (
|
||||
genSourceDepTag = dependencyTag{name: "gen source"}
|
||||
genHeaderDepTag = dependencyTag{name: "gen header"}
|
||||
@@ -572,7 +589,7 @@ var (
|
||||
staticVariantTag = dependencyTag{name: "static variant"}
|
||||
vndkExtDepTag = dependencyTag{name: "vndk extends"}
|
||||
dataLibDepTag = dependencyTag{name: "data lib"}
|
||||
runtimeDepTag = dependencyTag{name: "runtime lib"}
|
||||
runtimeDepTag = installDependencyTag{name: "runtime lib"}
|
||||
testPerSrcDepTag = dependencyTag{name: "test_per_src"}
|
||||
stubImplDepTag = dependencyTag{name: "stub_impl"}
|
||||
)
|
||||
@@ -599,8 +616,7 @@ func IsHeaderDepTag(depTag blueprint.DependencyTag) bool {
|
||||
}
|
||||
|
||||
func IsRuntimeDepTag(depTag blueprint.DependencyTag) bool {
|
||||
ccDepTag, ok := depTag.(dependencyTag)
|
||||
return ok && ccDepTag == runtimeDepTag
|
||||
return depTag == runtimeDepTag
|
||||
}
|
||||
|
||||
func IsTestPerSrcDepTag(depTag blueprint.DependencyTag) bool {
|
||||
|
Reference in New Issue
Block a user