Update gtest flags from Make
am: 8146b2f1c9
* commit '8146b2f1c90cb86c488a385dc912deba6de78553':
Update gtest flags from Make
Change-Id: I4c260b2611924815e3d0447b4f0e7cb9bd16c0b5
This commit is contained in:
commit
4faa4d6aa9
21
cc/cc.go
21
cc/cc.go
|
@ -456,6 +456,7 @@ type ModuleContextIntf interface {
|
||||||
noDefaultCompilerFlags() bool
|
noDefaultCompilerFlags() bool
|
||||||
sdk() bool
|
sdk() bool
|
||||||
sdkVersion() string
|
sdkVersion() string
|
||||||
|
selectedStl() string
|
||||||
}
|
}
|
||||||
|
|
||||||
type ModuleContext interface {
|
type ModuleContext interface {
|
||||||
|
@ -637,6 +638,13 @@ func (ctx *moduleContextImpl) sdkVersion() string {
|
||||||
return ctx.mod.Properties.Sdk_version
|
return ctx.mod.Properties.Sdk_version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ctx *moduleContextImpl) selectedStl() string {
|
||||||
|
if stl := ctx.mod.stl; stl != nil {
|
||||||
|
return stl.Properties.SelectedStl
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func newBaseModule(hod common.HostOrDeviceSupported, multilib common.Multilib) *Module {
|
func newBaseModule(hod common.HostOrDeviceSupported, multilib common.Multilib) *Module {
|
||||||
return &Module{
|
return &Module{
|
||||||
hod: hod,
|
hod: hod,
|
||||||
|
@ -2058,7 +2066,18 @@ func (test *testLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
||||||
|
|
||||||
func (test *testLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (test *testLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
if test.Properties.Gtest {
|
if test.Properties.Gtest {
|
||||||
deps.StaticLibs = append(deps.StaticLibs, "libgtest_main", "libgtest")
|
if ctx.sdk() && ctx.Device() {
|
||||||
|
switch ctx.selectedStl() {
|
||||||
|
case "ndk_libc++_shared", "ndk_libc++_static":
|
||||||
|
deps.StaticLibs = append(deps.StaticLibs, "libgtest_main_ndk_libcxx", "libgtest_ndk_libcxx")
|
||||||
|
case "ndk_libgnustl_static":
|
||||||
|
deps.StaticLibs = append(deps.StaticLibs, "libgtest_main_ndk_gnustl", "libgtest_ndk_gnustl")
|
||||||
|
default:
|
||||||
|
deps.StaticLibs = append(deps.StaticLibs, "libgtest_main_ndk", "libgtest_ndk")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
deps.StaticLibs = append(deps.StaticLibs, "libgtest_main", "libgtest")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
deps = test.binaryLinker.deps(ctx, deps)
|
deps = test.binaryLinker.deps(ctx, deps)
|
||||||
return deps
|
return deps
|
||||||
|
|
Loading…
Reference in New Issue