cc_cmake_snapshot: fix cc_test and cc_benchmark

Bug: 341997808
Test: aosp/3083875
Change-Id: Id6c2c5032a9963b74485fbfe40c0f2bde1dae5a4
This commit is contained in:
Tomasz Wasilczyk 2024-05-30 07:48:40 -07:00
parent c562e50fe5
commit 6e2b8c022c

View file

@ -489,17 +489,24 @@ func getModuleType(m *Module) string {
return "library" return "library"
case *testBinary: case *testBinary:
return "executable" 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 { func getExtraLibs(m *Module) []string {
switch decorator := m.linker.(type) { switch decorator := m.linker.(type) {
case *testBinary: case *testBinary:
if decorator.testDecorator.gtest() { if decorator.testDecorator.gtest() {
return []string{"libgtest"} return []string{
"libgtest",
"libgtest_main",
} }
} }
case *benchmarkDecorator:
return []string{"libgoogle-benchmark"}
}
return nil return nil
} }