summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Mumford <cmumford@chromium.org>2020-11-30 16:16:39 -0800
committerChris Mumford <cmumford@chromium.org>2020-11-30 16:16:39 -0800
commit28df52115d3ed989fa927e50aa2bd8d63c5aade0 (patch)
tree868c389ea97663f41c2c8ae7f96c9562eef049d4
parent2dcbd4a2c5c341a8eb7bb9b2035cb82ed940e4bd (diff)
parent37d36c92f8622595aa791867775d2f4d82e45be7 (diff)
downloadleveldb-28df52115d3ed989fa927e50aa2bd8d63c5aade0.tar.gz
Merge pull request #853 from cmumford:benchmark
PiperOrigin-RevId: 344909677
-rw-r--r--.gitmodules3
-rw-r--r--CMakeLists.txt7
2 files changed, 9 insertions, 1 deletions
diff --git a/.gitmodules b/.gitmodules
index 5a4e85a..6e6d3f0 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae9b0f7..7ecf317 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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
@@ -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