Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IANR1P
参考standalone的对应修改,注释改为英文,gtest_private_config_rtti的include_dirs = [ "$googletest_dir" ]
修改链接库的判断逻辑,和OHOS大仓保持一致,注意了命名规范
Signed-off-by: jialChen <jialiang1998@csu.edu.cn>
Change-Id: Ifcf0550be0a90e953baa014b279c04fe1b6ecb91
This commit is contained in:
jialChen 2024-09-02 17:57:22 +08:00
parent 5b040b7072
commit b2b4348b48
2 changed files with 16 additions and 3 deletions

View File

@ -75,7 +75,14 @@ template("ohos_unittest") {
deps += invoker.deps
}
deps +=
[ "//arkcompiler/toolchain/build/third_party_gn/googletest:gtest_main" ]
# Add static link library judgment logic below
if (defined(invoker.rtti_compile_flag) && invoker.rtti_compile_flag) {
deps += [ "//arkcompiler/toolchain/build/third_party_gn/googletest:gtest_rtti_main" ]
} else {
deps += [
"//arkcompiler/toolchain/build/third_party_gn/googletest:gtest_main",
]
}
}
}

View File

@ -21,7 +21,7 @@ config("gtest_private_config") {
config("gtest_private_config_rtti") {
visibility = [ ":*" ]
include_dirs = [ "googletest" ]
include_dirs = [ "$googletest_dir" ]
cflags = [ "-frtti" ]
cflags_objcc = [ "-frtti" ]
cflags_cc = [ "-frtti" ]
@ -111,6 +111,12 @@ static_library("gtest_rtti") {
configs += [ ":gtest_private_config_rtti" ]
}
static_library("gtest_rtti_main") { # ADD
testonly = true
sources = [ "$googletest_dir/src/gtest_main.cc" ]
public_deps = [ ":gtest_rtti" ]
}
static_library("gtest_main") {
testonly = true
sources = [ "$googletest_dir/src/gtest_main.cc" ]