Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34cbba6e authored by Christopher Ferris's avatar Christopher Ferris
Browse files

Add liblog as shared dependency for isolated tests.

If liblog is a static library, then unit tests cannot properly
override log functions.

Test: Build isolated tests and run them.
Change-Id: Id202c5950518408ce66ceea70988dde8080fd1f9
parent ed1f4def
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -210,6 +210,11 @@ func (test *testDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
			deps.StaticLibs = append(deps.StaticLibs, "libgtest_main_ndk_c++", "libgtest_ndk_c++")
		} else if BoolDefault(test.Properties.Isolated, false) {
			deps.StaticLibs = append(deps.StaticLibs, "libgtest_isolated_main")
			// The isolated library requires liblog, but adding it
			// as a static library means unit tests cannot override
			// liblog functions. Instead make it a shared library
			// dependency.
			deps.SharedLibs = append(deps.SharedLibs, "liblog")
		} else {
			deps.StaticLibs = append(deps.StaticLibs, "libgtest_main", "libgtest")
		}