2023-03-09 09:38:06 +00:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
|
|
|
@@ -306,29 +306,12 @@
|
2021-05-15 13:41:09 +00:00
|
|
|
if(SNAPPY_BUILD_TESTS)
|
|
|
|
enable_testing()
|
|
|
|
|
|
|
|
- # Prevent overriding the parent project's compiler/linker settings on Windows.
|
|
|
|
- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
|
|
|
- set(install_gtest OFF)
|
|
|
|
- set(install_gmock OFF)
|
|
|
|
- set(build_gmock ON)
|
|
|
|
-
|
|
|
|
- # This project is tested using GoogleTest.
|
|
|
|
- add_subdirectory("third_party/googletest")
|
|
|
|
-
|
|
|
|
- # GoogleTest triggers a missing field initializers warning.
|
|
|
|
- if(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
|
|
|
|
- set_property(TARGET gtest
|
|
|
|
- APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
|
|
|
|
- set_property(TARGET gmock
|
|
|
|
- APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
|
|
|
|
- endif(SNAPPY_HAVE_NO_MISSING_FIELD_INITIALIZERS)
|
|
|
|
-
|
|
|
|
add_executable(snappy_unittest "")
|
|
|
|
target_sources(snappy_unittest
|
|
|
|
PRIVATE
|
|
|
|
"snappy_unittest.cc"
|
|
|
|
)
|
|
|
|
- target_link_libraries(snappy_unittest snappy_test_support gmock_main gtest)
|
|
|
|
+ target_link_libraries(snappy_unittest snappy_test_support gtest_main gtest)
|
|
|
|
|
|
|
|
add_test(
|
|
|
|
NAME snappy_unittest
|
2023-03-09 09:38:06 +00:00
|
|
|
@@ -349,12 +332,11 @@
|
2021-05-15 13:41:09 +00:00
|
|
|
PRIVATE
|
|
|
|
"snappy_benchmark.cc"
|
|
|
|
)
|
|
|
|
- target_link_libraries(snappy_benchmark snappy_test_support benchmark_main)
|
|
|
|
+ target_link_libraries(snappy_benchmark snappy_test_support benchmark_main benchmark)
|
|
|
|
|
|
|
|
# This project uses Google benchmark for benchmarking.
|
|
|
|
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
|
|
|
|
set(BENCHMARK_ENABLE_EXCEPTIONS OFF CACHE BOOL "" FORCE)
|
|
|
|
- add_subdirectory("third_party/benchmark")
|
|
|
|
endif(SNAPPY_BUILD_BENCHMARKS)
|
|
|
|
|
|
|
|
if(SNAPPY_FUZZING_BUILD)
|