Cleanup gtest cmake config

This commit is contained in:
Victor Zverovich
2025-12-09 18:17:46 -08:00
parent 3269c1cea5
commit ec73fb7247

View File

@@ -1,7 +1,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Build the google test library # Build the google test library
# We compile Google Test ourselves instead of using pre-compiled libraries. # Compile Google Test ourselves instead of using pre-compiled libraries.
# See the Google Test FAQ "Why is it not recommended to install a # See the Google Test FAQ "Why is it not recommended to install a
# pre-compiled copy of Google Test (for example, into /usr/local)?" # pre-compiled copy of Google Test (for example, into /usr/local)?"
# at http://code.google.com/p/googletest/wiki/FAQ for more details. # at http://code.google.com/p/googletest/wiki/FAQ for more details.
@@ -19,14 +19,10 @@ else ()
endif () endif ()
if (MSVC) if (MSVC)
# Disable MSVC warnings of _CRT_INSECURE_DEPRECATE functions. # Disable MSVC warnings about _CRT_INSECURE_DEPRECATE functions.
target_compile_definitions(gtest PRIVATE _CRT_SECURE_NO_WARNINGS) target_compile_definitions(gtest PRIVATE _CRT_SECURE_NO_WARNINGS)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Disable MSVC warnings of POSIX functions. # Disable MSVC warnings about POSIX functions.
target_compile_options(gtest PUBLIC -Wno-deprecated-declarations) target_compile_options(gtest PUBLIC -Wno-deprecated-declarations)
endif () endif ()
endif () endif ()
# Silence MSVC tr1 deprecation warning in gmock.
target_compile_definitions(gtest
PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1)