cc_cmake_snapshot: fix cc_test and cc_benchmark
Bug: 341997808
Test: aosp/3083875
Change-Id: Id6c2c5032a9963b74485fbfe40c0f2bde1dae5a4
diff --git a/cc/cmake_snapshot.go b/cc/cmake_snapshot.go
index c21a46f..0f60e90 100644
--- a/cc/cmake_snapshot.go
+++ b/cc/cmake_snapshot.go
@@ -489,16 +489,23 @@
return "library"
case *testBinary:
return "executable"
+ case *benchmarkDecorator:
+ return "executable"
}
- panic(fmt.Sprintf("Unexpected module type: %T", m.compiler))
+ panic(fmt.Sprintf("Unexpected module type: %T", m.linker))
}
func getExtraLibs(m *Module) []string {
switch decorator := m.linker.(type) {
case *testBinary:
if decorator.testDecorator.gtest() {
- return []string{"libgtest"}
+ return []string{
+ "libgtest",
+ "libgtest_main",
+ }
}
+ case *benchmarkDecorator:
+ return []string{"libgoogle-benchmark"}
}
return nil
}