Add and use staticLibrary()
Add staticLibrary() that returns true for a static variant of a
library, and replace all instances of foo.static() && !foo.staticBinary()
with foo.staticLibrary.
Test: builds
Change-Id: I0bf0c18669c24f23ebc9cc33d525b86d81e22d40
diff --git a/cc/cc.go b/cc/cc.go
index 4838a5f..8023324 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -519,6 +519,7 @@
type ModuleContextIntf interface {
static() bool
staticBinary() bool
+ staticLibrary() bool
testBinary() bool
testLibrary() bool
header() bool
@@ -1523,6 +1524,10 @@
return ctx.mod.staticBinary()
}
+func (ctx *moduleContextImpl) staticLibrary() bool {
+ return ctx.mod.staticLibrary()
+}
+
func (ctx *moduleContextImpl) testBinary() bool {
return ctx.mod.testBinary()
}
@@ -3550,6 +3555,15 @@
return false
}
+func (c *Module) staticLibrary() bool {
+ if static, ok := c.linker.(interface {
+ staticLibrary() bool
+ }); ok {
+ return static.staticLibrary()
+ }
+ return false
+}
+
func (c *Module) staticBinary() bool {
if static, ok := c.linker.(interface {
staticBinary() bool