2023-10-30 17:44:34 +00:00
|
|
|
set(GTEST_ROOT_DIR ${TR_THIRD_PARTY_SOURCE_DIR}/googletest/googletest)
|
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
add_library(gtestall STATIC)
|
2022-11-12 20:01:57 +00:00
|
|
|
|
2023-12-23 16:32:04 +00:00
|
|
|
# GTest 1.12 triggers nullptr warnings in gcc 13
|
|
|
|
set(CACHE_ID "${CMAKE_CXX_COMPILER_ID}_CXX_HAS-Wnull-dereference")
|
|
|
|
string(TOLOWER "${CACHE_ID}" CACHE_ID)
|
|
|
|
check_c_compiler_flag(-Wnull-dereference ${CACHE_ID})
|
|
|
|
if(${CACHE_ID})
|
|
|
|
target_compile_options(gtestall PRIVATE -Wno-null-dereference)
|
|
|
|
endif()
|
|
|
|
|
2023-01-01 19:49:48 +00:00
|
|
|
target_sources(gtestall
|
|
|
|
PRIVATE
|
2023-10-30 17:44:34 +00:00
|
|
|
${GTEST_ROOT_DIR}/src/gtest-all.cc
|
|
|
|
${GTEST_ROOT_DIR}/src/gtest_main.cc)
|
2023-01-01 19:49:48 +00:00
|
|
|
|
|
|
|
set_property(
|
|
|
|
TARGET gtestall
|
2023-10-30 17:44:34 +00:00
|
|
|
PROPERTY FOLDER "${TR_THIRD_PARTY_DIR_NAME}")
|
2023-01-01 19:49:48 +00:00
|
|
|
|
|
|
|
target_include_directories(gtestall SYSTEM
|
|
|
|
PRIVATE
|
2023-10-30 17:44:34 +00:00
|
|
|
${GTEST_ROOT_DIR}
|
2023-01-01 19:49:48 +00:00
|
|
|
PUBLIC
|
2023-10-30 17:44:34 +00:00
|
|
|
${GTEST_ROOT_DIR}/include)
|