From 83253929507a0926e40034f40aad694a66dbe899 Mon Sep 17 00:00:00 2001 From: Richard O'Grady Date: Thu, 13 Apr 2023 10:03:01 -0700 Subject: [PATCH] Disable Wimplicit-int-float-conversion warning in googletest PiperOrigin-RevId: 524031046 --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0082f57..85afe58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,6 +146,8 @@ endif(SNAPPY_REQUIRE_AVX2) # Used by googletest. check_cxx_compiler_flag(-Wno-missing-field-initializers SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS) +check_cxx_compiler_flag(-Wno-implicit-int-float-conversion + SNAPPY_HAVE_NO_IMPLICIT_INT_FLOAT_CONVERSION) include(CheckCXXSourceCompiles) check_cxx_source_compiles(" @@ -334,6 +336,11 @@ if(SNAPPY_BUILD_TESTS) APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers) endif(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS) + if(SNAPPY_HAVE_NO_IMPLICIT_INT_FLOAT_CONVERSION) + set_property(TARGET gtest + APPEND PROPERTY COMPILE_OPTIONS -Wno-implicit-int-float-conversion) + endif(SNAPPY_HAVE_NO_IMPLICIT_INT_FLOAT_CONVERSION) + add_executable(snappy_unittest "") target_sources(snappy_unittest PRIVATE