Skip to content

Commit

Permalink
Merge pull request #853 from cmumford:benchmark
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 344909677
  • Loading branch information
cmumford committed Dec 1, 2020
2 parents 2dcbd4a + 37d36c9 commit 28df521
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "third_party/googletest"]
path = third_party/googletest
url = https://github.com/google/googletest.git
[submodule "third_party/benchmark"]
path = third_party/benchmark
url = https://github.com/google/benchmark
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ if(LEVELDB_BUILD_TESTS)
# This project is tested using GoogleTest.
add_subdirectory("third_party/googletest")

# 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")

# GoogleTest triggers a missing field initializers warning.
if(LEVELDB_HAVE_NO_MISSING_FIELD_INITIALIZERS)
set_property(TARGET gtest
Expand All @@ -318,7 +323,7 @@ if(LEVELDB_BUILD_TESTS)

"${test_file}"
)
target_link_libraries("${test_target_name}" leveldb gmock gtest)
target_link_libraries("${test_target_name}" leveldb gmock gtest benchmark)
target_compile_definitions("${test_target_name}"
PRIVATE
${LEVELDB_PLATFORM_NAME}=1
Expand Down

0 comments on commit 28df521

Please sign in to comment.