1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 00:04:06 +00:00
transmission/tests/gtest/CMakeLists.txt
Charles Kerr 581d9c34cc
fix: gcc-13 warnings pt. 2 (#6404)
* fix: tr_priority_t usage warnings

* build: disable -Wnull-dereference warnings when building GTest

* fix: -Wunused-result warning in tr_spawn_async()

* fix: -Warray-bounds warning in NetTest::compact4()
2023-12-23 10:32:04 -06:00

26 lines
740 B
CMake

set(GTEST_ROOT_DIR ${TR_THIRD_PARTY_SOURCE_DIR}/googletest/googletest)
add_library(gtestall STATIC)
# 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()
target_sources(gtestall
PRIVATE
${GTEST_ROOT_DIR}/src/gtest-all.cc
${GTEST_ROOT_DIR}/src/gtest_main.cc)
set_property(
TARGET gtestall
PROPERTY FOLDER "${TR_THIRD_PARTY_DIR_NAME}")
target_include_directories(gtestall SYSTEM
PRIVATE
${GTEST_ROOT_DIR}
PUBLIC
${GTEST_ROOT_DIR}/include)