From 7c6f3d8477b999190a7895af50b62026ba98eeae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=90=83=E7=8A=B6=E9=97=AA=E7=94=B5?= Date: Wed, 8 Jul 2020 18:50:58 -0700 Subject: [PATCH] fix compile error (#7040) Summary: WITH_TESTS=OFF and WITH_BENCHMARK_TOOLS=ON there has errors: /bin/ld: cannot find -ltestharness Pull Request resolved: https://github.com/facebook/rocksdb/pull/7040 Reviewed By: riversand963 Differential Revision: D22447637 Pulled By: ajkr fbshipit-source-id: f63058376deb4a2e6722d63541c40caa617c331a --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91647d83b..08b48d2eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -986,11 +986,14 @@ endif() option(WITH_ALL_TESTS "Build all test, rather than a small subset" ON) -if(WITH_TESTS) +if(WITH_TESTS OR WITH_BENCHMARK_TOOLS) add_subdirectory(third-party/gtest-1.8.1/fused-src/gtest) add_library(testharness STATIC test_util/testharness.cc) target_link_libraries(testharness gtest) +endif() + +if(WITH_TESTS) set(TESTS db/db_basic_test.cc env/env_basic_test.cc